Context("table")

It would be cool to be able to know “what” data set someone is interacting with. Tables/Slices.

Status Open
9 15 1,426
15 Comments
Bahbus
Participant V

Should be able to kinda figure that out based on what “View” they are in.

Grant_Stead
Participant V

Of course I can…
This would be easier/fool proof.

tony1
Participant V

@Grant_Stead We’ve got this our our todo list.

Bahbus
Participant V

Lol, fair enough. As a workaround, append the slice/table name to the beginning of the view name followed with an underscore. Then check INDEX(SPLIT(CONTEXT("View"), "_"), 1).

(or some other delimiter if underscores are used in your table/slice names)

Grant_Stead
Participant V

Yep, already rocking naming conventions and doing something similar.
Feature requests are intended to replace workarounds…

GreenFlux
Participant V

I just realized CONTEXT("Table") is working now! Thanks @tony!

Any chance you are working on CONTEXT("Slice") next? I tried but “slice” returns blank (but does not evaluate as an error, either).

tony1
Participant V

Kudos to @yichengr on his first feature release!

Grant_Stead
Participant V

Nice!

Grant_Stead
Participant V

@tony This seems to only return the table name… I keep thinking it’ll return the slice or table… but it doesn’t. Any chance CONTEXT(“Slice”) is in the pipeline and could return the slice if there is a slice else table name?

GreenFlux
Participant V

@Grant_Stead, I agree, this would be very useful. I needed it once before and ended up naming my views using the format:
{Table/SliceName}_{ViewType} , i.e. ActiveEmployee_Detail.

If you do this consistently with your naming, then you can get the slice name with:
INDEX(SPLIT(CONTEXT(View),"_"),1)


@tony, if this does get added, could we please get CONTEXT(ColumnName) or [_THISCOLUMNNAME] too?

I’d like to store Display Names in a table and look them up, so that every column could use the exact same expression for the display name:
LOOKUP([_THISCOLUMNNAME],ColumnsTable,ColumnName,DisplayName)

This technique could also be used in just about any column setting if we had a way to reference the name of the current column. The LOOKUP could be used to set values for Initial_Value, Valid_If, etc. and the same formula would work in every field since the column name would be dynamic.

Grant_Stead
Participant V

Yes sir, that’s where we’re at…

Status changed to: Open
Pratyusha
Community Manager
Community Manager
 
HSAI
Participant I

Is there a way to use context(table) in a table formula (e.g. for suggested values)

I tried:

FILTER(CONTEXT(Table),[LEVEL]<3)

But it doesn't recognise the context in place of the table name, and it would make easier work of updating tables without needing to re-write formulas

SkrOYC
Participant V

@HSAI
Think on a bigger scale. You want a FILTER() expression to work on any view/table basically (from your app pov) but are you sure [LEVEL] is on all of them? Even if this would work it just doesn't make sense

HSAI
Participant I

Hi @SkrOYC 

Agree this wasn't the right example to use, filtering would generally be from another table. Nonetheless, using something like CONTEXT(Table) or [_THISTABLE] in a formula that is a dynamic placeholder for the name of the current table would remove the need to re-work formulas when the source table changes in name. Perhaps what I'm actually suggesting here isn't really CONTEXT, it's more so [_THISTABLE] as a placeholder