Display name expression for different name depending on view type?

Hey all. I would love to have the column name be different depending on whether itโ€™s a table view or detail view.

Iโ€™m using a dashboard for table view in an inventory app and Iโ€™d like the column name to just be narrow, OH QTY (short for on hand quantity) but for a detail view it would be nice to have the full name since there is more room. ON HAND QUANTITY.

Can anyone help w the expression here? Would it be an IF expression and then use CONTEXT somehow?

1 5 589
5 REPLIES 5

Try this.

SWITCH(CONTEXT(โ€œput here view nameโ€),
โ€œview1โ€,โ€col name 1โ€,
โ€œview2โ€,โ€col name 2โ€,
โ€œDefault col nameโ€)

Steve
Platinum 4
Platinum 4

should instead be:

SWITCH(CONTEXT(โ€œViewโ€),
โ€œview1โ€,โ€col name 1โ€,
โ€œview2โ€,โ€col name 2โ€,
โ€œDefault col nameโ€)

The argument to CONTEXT() should be the raw text value, View, not the name of the view.

See also:

Great I figured that out @Steve thank you!

What I noticed is the column names do not show as either of the two custom names in a dashboard view but rather just the default. Is this normal behavior?

I was hoping to have a list view with a short name and detail view with a longer name in a dashboard

Iโ€™m not sure you can do thatโ€“though itโ€™s not something Iโ€™ve (recently?) tried, so I canโ€™t say for sure.

@Steve I just realized a pretty easy workaround is a virtual column displaying the value of the first column and using that on one view and the original on the other view.

Duh lol

Top Labels in this Space