CONTEXT(“ROW”)

Can we get a Context(“row”) to get the id of the row that the user is in when being in a detail view? 🙏

I usually work around this by setting up a column that saves the current row selected by the user, but this takes several seconds to update in the UI.

This would be useful for virtual columns in embedded views inside other embedded view like a table view in a cart view that’s inside a detail view. 

or is there already a way to achieve this faster than what I’m currently doing?

Status Open
4 17 397
17 Comments
MultiTech
Gold 4
Gold 4

This is something that's already been asked for; please find that request and add your vote!

The only way they take these things seriously is if they have more than single digit vote counts!

khiemtg
Bronze 5
Bronze 5

I've been encountering same issue, really waiting for this Context option to be available

Karimmc2
Silver 2
Silver 2

If you have encountered this same need please upvote either this post or @MultiTech 's post in here.

 

khiemtg
Bronze 5
Bronze 5

okay, I voted, thank you

Karimmc2
Silver 2
Silver 2

Thanks!

This is a very much needed CONTEXT(), both for performance and functionality.  More of a need-to-have than a nice-to-have feature.

Is it at least under a long term scope?🙏

@lizlynch 

SkrOYC
Gold 5
Gold 5

Just curious, [_THISROW] doesn't work?

khiemtg
Bronze 5
Bronze 5

@Karimmc2 Totally agree

Karimmc2
Silver 2
Silver 2

@SkrOYC  [_THISROW] works fine when referencing from the same table, but I haven't come across a built in solution for referencing the current row the user is in (in a detail view) from another table (a nested view inside the current detail view). 

SkrOYC
Gold 5
Gold 5

@Karimmc2 So basically you want to see [_THISROW] but from inside an inline view?

Karimmc2
Silver 2
Silver 2

@SkrOYC Yes, exactly. 

I've been doing this by recording the last row the user selected but this way takes too long to calculate and display the correct value.

Any ideas?

dbaum
Gold 4
Gold 4

It sounds like you need to be able to reference the parent row in an expression in a child row, which should be straightforward (i.e., [Parent ID].[Another Column from Parent Table]). So, I'm sure that at least I am missing something. If you explain differently, I or others might have ideas to offer.

Karimmc2
Silver 2
Silver 2

@dbaum Yes, sorry I missed that detail.

This case is when there is no direct reference between the tables that can be used in a simple/ fast virtual column, and other methods (like recording the last record opened by the user) create laggy virtual columns.

An specific case would be:

a Warehouses Table > a Products Table > and a ProductEntries Table with [warehouse], [product] and [quantity] columns. 

In a Warehouses View I want the user to be able to get into a Warehouse Detail View and have an Inline View of the Products Table displaying each individual product in that warehouse and the total quantity of that product in that warehouse. 

What I would like to achieve is a virtual column in the Products Table displaying the total quantity of that product in the warehouse being currently displayed to the user, ideally looking something like this: 

SUM(
   SELECT(
      ProductEntries[quantity],
      AND(
         [product]=[_THISROW].[product_id],
         [warehouse]=CONTEXT("ROW")
         )
       )
     )

An easy way out would be using a ProductEntries Inline View grouped by Products and using SUM as the group aggregate, however this is very real estate expensive in the UI since it displays all of the ProductEntries records and also it does not allow for actions in the Products Table.

Is there another way you would solve this?

@SkrOYC 

dbaum
Gold 4
Gold 4

Thanks for explaining. I don't have any great ideas. I look forward to any best practices for this scenario from experts in the community.

A couple thoughts meanwhile:

  • Use a User Setting or other universal filter for the user to select the preferred warehouse to apply
  • If there is a manageable and static list of warehouses, create a dedicated virtual column for each
Karimmc2
Silver 2
Silver 2

@dbaum Thanks for the response. I have not tried this approach yet, I’ll try and see if the calculated values update faster. The goal is to get the current row of the user in an instant way, even if there is no reference in the Inline table. 
Thanks!

MultiTech
Gold 4
Gold 4

@Karimmc2 wrote:

What I would like to achieve is a virtual column in the Products Table displaying the total quantity of that product in the warehouse being currently displayed to the user


For this to work, you need a way to communicate to the system WHAT the user has selected....
   - and for this you'll need to implement an enhanced dashboard system.

  • I've got a video + sample app that shows how to set this up
  • Enhanced Dashboard Sample App.png

But the gist of things is:

  • You'll need to add some "filter" columns to your User table (which you might need to implement to make this work) using the Current User system to create a space where users can change their specific filter settings; from these you can then create slices, VCs, formatting rules, etc.