Conditional formatting

I know that Glide is pretty stiff on design, and doesn’t give the freedom to the user/developer to break design guidelines, but one thing cruelly missing is conditional formatting, where for example we could make some text red or bold upon some alerting condition. That gives an annoying advantage to viewing our data in Google Sheets where this feature exists.

2 Likes

Hi Michael,

There are some (bit time intensive) ways around this that work OK at the moment. I’ve been playing around with it in on of my projects.
Since the component Rich Text supports markdown, you can:

  • use IF() functions for the conditional part
  • use markdown supported formatting for the formating part.

You can (even if not entirely advised atm) also use some html for further formatting.

Hope this helps!

Could you give us some context on what the data in your app is, and what the alerting conditions are? Maybe a screenshot of your spreadsheet?

Agree, @Michael, conditional formatting would be great to have.
I haven’t found a possibility to use colors in markdown syntax as @Karim suggested, only bold or italic.
So I added in Data Editor a new “if-then-else” relation column, where I added colored emoticons (to code noun gender).

Hi Natalia,

This helped me a lot in figuring it out.
You need to use some HTML synthax:

1 Like

@Mark Sure…
See a screenshot of my app (pardon my Hebrew :slight_smile:)
What you see here is an inline list of budget lines, and I want to color the items with negative values with a red font, for example. The solution I chose in the meanwhile are those traffic light images…

If you look at the sheet for example, the background colors for alerting cells are relatively more communicative.

shlita_cat_list_sheet

Thanks, Karim, just tried it and it works :+1:

1 Like

@Karim and @NataliaGo . Just a warning that Glide does not recommend using HTML as part of the Rich Text component as they may in the future not support it. I suspect that they are giving that warning because whatever markdown interpreter/implementation (not sure if that is the technical term for it) they use may drop support for it for security reasons. Even the link that Karim shows eludes to that.

"Now, StackOverflow (and probably GitHub) will strip the raw HTML out (as a security measure) so you lose the color here, but it should work on any standard Markdown implementation."

2 Likes

Does it also support markdown in custom template columns ? And eventually in list items using values from such custom columns ?
Well I tried and my words remained with asterisks…

Sure it does. You just need to use it in a Rich Text component. It’s a bad example below but the column Approved was used in the Template and as you can see it is bold in the Rich Text component that I added as the last component.

1 Like

Yes, thanks @George_B, I’ve read it, so decided to stay with my Rich Text Format column idea. At least for this specific case. But it was fun to try it once for my other app:laughing:

1 Like

@Michael Sorry I missed the part of your question about list items showing markdown. In that case no, they don’t support markdown.

1 Like

@Michael @George_B that’s why I think emoticons are a way to go, maybe it will not always be appropriate and relevant, but you can add :x::heavy_multiplication_x::white_check_mark::arrow_upper_right::arrow_lower_right: various signals in the column with if-then.-else.

1 Like

@NataliaGo Agreed.

@NataliaGo Yes that’s what I’ve been doing too, with custom images

1 Like