Format Rule Expression

Hi.

I have an EnumList Column called [Treatment Type] in Create Works Order Table and I want to create a simple Format Rule with conditional expressions that displays each of the options differently. Every expression I try just returns Cannot Compare List and Text.

Any help would be great, thank you.

Solved Solved
0 15 744
  • UX
1 ACCEPTED SOLUTION

@MauriceWhelan
Then the only chance is the way I have proposed. You cannot apply the format rule otherwise. Check if this is what you want:

View solution in original post

15 REPLIES 15

@MauriceWhelan
I donโ€™t think you can format each item of an Enumlist separately, because AppSheet will treat it as a single concatenated string at the end. However, provided you build a small table for those [Treatment Type] values (not sure how many of them you have) and construct your Enumlist as REF type, if you apply a formatting rule for each of the item in that small table, the Enumlist will reflect those values. This is the quickest way I can think of.

May be @Steve and/or @Aleksi might propose a better solution.

Many thanks for this suggestion @LeventK.

Youโ€™re welcome @MauriceWhelan, my pleasure

Hi @LeventK

Can I just check the steps that I have carried out with you?

  1. Created a table called Miscellaneous with Column [Treatment Type]
  2. Changed the Base Type of my [Treatment Type] EnumList column in my Create Works Order table to Ref type and selected Miscellaneous as Referenced Table.
  3. Created a format rule for [Treatment Type] option 1 in Miscellaneous Table and set conditional expression to [Treatment Type] = โ€œCSPโ€

But when I look at that value in the drop down list it is unformatted.

Have I missed something in my set up?

Many thanks.

I donโ€™t think format rules work within the drop downs. Only outside of them.

@MauriceWhelan
Have you set the expression in Valid_if to get the ref values?

SELECT(
	RefTableName[KeyColumn],TRUE)
)

In my sample app itโ€™s set like this:
2X_7_791ee4bbb847b8866721b7c778dbfb6d95db1edd.png



Hi @LeventK

Thank you for that. My bad. My select function was slightly wrong. I was using [Treatment Type] column instead of [Record ID]. Made the change and it is working perfectly now.

Many thanks again.

Youโ€™re welcomeโ€ฆGlad to hear that you have resolved the issue

Steve
Platinum 4
Platinum 4

Differently in what way?

This should be easy to correct. What is/are your expression(s)?

@Steve

I just want the text values to be different colours.The 3 options are CSP, ReDip, Standard.

I have tried SELECT(Create Works Order[Treatment Type],[Treatment Type]=โ€œCSPโ€)
I also tried with IN() expression.

@MauriceWhelan
How is your Enumlist content is set up? Hardcoded, or are you using a SELECT(โ€ฆ) expression in Valid_if or Suggested_Values property?

@LeventK

At the moment they are hardcoded values.

@MauriceWhelan
Then the only chance is the way I have proposed. You cannot apply the format rule otherwise. Check if this is what you want:

@LeventK

Exactly what I am looking for. Thanks a million for that.

Youโ€™re welcome @MauriceWhelan, my pleasure. Could you please mark my post as solution?

Top Labels in this Space