About format rules in different views Hi all...

expressions
(Mario Monsalve) #1

About format rules in different views

Hi all,

I’m trying to use 2 or 3 different format rules for the same data, depending on the app’s view that the user is currently displaying.

For each rule I use the condition #view=xxxxx , as indicated in the expression assistant but it’s not working: when the condition is set, the rule doesn’t work and if I remove the condition, the last rule is applied (as intended)

I also tried to make a slice of data, but can’t apply the rule to a slice, only to tables.

Am I doing something wrong? Any ideas to display the same data with different format depending on the view you are using?

Thanks in advance.

(Levent KULAÇOĞLU) #2

@Mario_Monsalve Format Rules is applied to column, regardless of the UX the user is displaying. But can you elaborate your issue a bit more? Do you have the same column in more than one UX view?

(Mario Monsalve) #3

Hi @Levent_KULACOGLU and thanks for your reply.

I have 1 table with (let’s say) column NAMES and column POSITIONS.

In the first view (“GROUP_VIEW”) I want to group data by POSITION and then each name with the same position sorted alphabeticvally. It’s done and it works OK. In this view the data stored in column POSITION must be formatted in bold green.

In the second view (“DETAIL_VIEW”) I want all the info for each person (like a detail view) and data stored in column POSITION must be without format (black, regular size, no bold, etc).

So I set a format rule in which condition is #view=GROUP_VIEW (as the expression assistant says) and format is color=green, bold=true.

But the condition doesn’t work. In both views, the POSITION is viewed in bold green.

So…one table, two views, the same data in both views but with different format in each one.

Any help would be much appreciated. Thanks!

(Steven Coile) #4

You cannot target a format rule to a specific view using expressions, as you are attempting. Instead, you’ll need to create additional (virtual) columns for the specific views and apply the view-specific formatting to them.

For instance, you could create a virtual column, [POSITION_GV] (GV for GROUP_VIEW), with an App formula of =[POSITION] (so it’s always an exact copy of [POSITION]). Then remove [POSITION] from GROUP_VIEW and replace it with [POSITION_GV]. Finally, in your format rule to make position bold green, again replace [POSITION] with [POSITION_GW].

(Mario Monsalve) #5

Hi, Steve and thanks for your reply.

Your solution works perfectly. Just one more question: could this method affect the app’s performance if I set up 3 or 4 virtual columns, for different views and the table has too many rows (200-300)?

Anyway, if it’s possible, I’d like the developers to explore the posbibility of using different format rules for different app’s views. I think it could be useful for many users.

Once again, many thanks for your help!

(Steven Coile) #6

@Mario_Monsalve Unless you have a huge dataset (thousands or tens of thousands of rows), I don’t know that I would be terribly concerned–especially given that there’s no alternative. It’s not optimal, but it’s what we’ve got.