How to create format rule by setting the condition from a datatype of "Enum List"

Hi, I'm struggling with the following.. perhaps someone can help me ?

I'm displaying an Enum List of answers/statements. A user needs to click certain answers that I consider "required". I have 2 columns , one defining a list of statements, the other a boolean list defining whether the answer is "required". See example below. 

[statements]          [required]

Statement A         TRUE

Statement B         FALSE

Statement C         TRUE

 

When displaying the list [statements], I'd like the "required" statements to appear Bold or add an icon next to them. I was able to achieve this in a very convoluted way which only works for a very basic static list. 

If this condition is true: 

OR(

IN("Statement A",[statements]),

IN("Statement B",[statements]),  etc...)

 

The list of [statements] however is ideally a dynamic list (built with SELECT function) and may change based on user's previous answers. So, a rudimentary solution such as the one depicted above doesn't quite cut it for me. ... I would need something that would achieve the following:

For each item in the [statements] list check [required] column and apply formatting based on that.

Any help would be greatly appreciated! Been only using Appsheet for a week, and already building very useful apps. I'm a big fan ๐Ÿ™‚

Thank you, URos 

Solved Solved
0 10 1,038
  • UX
1 ACCEPTED SOLUTION

In this post, @dbaum has explained the approach. Please take a look and please revert if you need any more help in this regard.

Formatting of Enum Buttons - Google Cloud Community

Edit:  Also the [Required] column is Yes /No or TRUE/FALSE type. In (Y/N) columns, you can simply use the column name, such as [Required] in this case to check if it is TRUE or FALSE. You do not need further arguments such as [Required]=TRUE or {Required]=FALSE

View solution in original post

10 REPLIES 10

You may want to mention if these statements list is used in another table as enumlist and if so , how have you configured it?

Thanks for the swift follow up. 

No, the [statements] list/column is only present in 1 table. .. and only used once within my app. Does that help you understand better?

Thank you. Could you share your settings of the Enumlist column, especially how are you building the list expression. 

I found a somewhat ugly workaround that works.. If I add an asterix " * " into the text values comprising the EnumList, I am able to use the following conditional formula:

CONTAINS([statements]  ," * ")

[statements]        

"Statement A * "

"Statement B"

"Statement C * "

This solution of course is not "pretty" and completely disregards the [required] Yes/No column.

So, I'm still VERY interested to find out if there is a better way?

 

Thank you!

As requested,  could you please mention,  how you are constructing the Enumlist?

I'm sorry that was not clear. The EnumList is constructed in a relatively straightforward manner, via a SELECT formula. ...such as:

EnumList is:  SELECT(TABLE[statements], [Display Statement At Location] = [WhereAmI])

Whereas [WhereAmI] is a dropdown with values: "Home", "Office",...

Please check the following example table which is technically identical to my scenario:

https://docs.google.com/spreadsheets/d/e/2PACX-1vQ4jthhDe0I8G81vujghNtcYK9JZkRIzbQ12CFDZUImLOaXBvG39...

... So If I'm at "Home" I will create a list of actions I need to do at home.. but only those marked "required" should display as BOLD in EnumList. 

Did I clear the confusion?

Thank you. If the Enumlist was created from a  referenced column that references the TABLE , then you could have used format rules in the TABLE itself with a simple expression such as [Required]. The  format  would have carried over to the reference column.

Anyway, based on details shared by you, it sounds that, your current approach is good enough.

>>>"....then you could have used format rules in the TABLE itself with a simple expression such as [Required]"

Thank you very much for the insight, but could you please provide an example formula of what you had in mind.. I will than play a little to make it work.. as long as you point me in the right direction would be great. 

I'm not a big fan of my workaround approach as it requires me to clutter my visible data with asterixis ***... .I'd much prefer to understand how to use the adjacent column [required] to control the visibility of the EnumList buttons. 

 

Would you be so kind and provide a sample "condition formula".

 

Thank you!

In this post, @dbaum has explained the approach. Please take a look and please revert if you need any more help in this regard.

Formatting of Enum Buttons - Google Cloud Community

Edit:  Also the [Required] column is Yes /No or TRUE/FALSE type. In (Y/N) columns, you can simply use the column name, such as [Required] in this case to check if it is TRUE or FALSE. You do not need further arguments such as [Required]=TRUE or {Required]=FALSE

Thank you very much for your time and kind assistance Gurjar !

 

 

 

Top Labels in this Space