Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Is Conditional Formatting applied

Featured Replies

Hi all

Is there a calculation that can determine whether a layout object's conditional formatting is applied at a given moment?

 

Thx

What would this be good for?

  • Author

Nothing major. I have buttons that have conditional formatting. I want to prevent the script running if the condition for the formatting is not met.

It would just save me having to have the criteria in both the script and the object's conditional formatting.

It would just save me having to have the criteria in both the script and the object's conditional formatting.

Can you capture the calculation logic into a custom function, and then cite that in both the conditional formatting expression and in a guard clause in your script?  That would allow you to maintain the underlying logic in just one place (DRY). Just a thought.

It would just save me having to have the criteria in both the script and the object's conditional formatting.

The best way to do this, IMHO, would be to define a calculation field and use the result both for the conditional formatting and for the script. Or use some layout object to declare a global variable, which you can then use in the same manner. Or perhaps a custom function will do (we know nothing of the nature of the calculation, so...).

The alternative using GetLayoutObjectAttribute() would be more complicated, not less - assuming it even works, which I haven't tested. Also keep in mind that a condition may exist, but the window hasn't been refreshed yet. It's best to stay at data level for this type of thing.

 

Edited by comment

  • Author

Thanks guys, I'll do an underlying calculation that both the script and formatting can refer to.

AFAIK GerLayoutObejctAttributes can't ascertain the type of formatting I'm using.

Cheers

AFAIK GerLayoutObejctAttributes can't ascertain the type of formatting I'm using.

We won't know that until you tell us what it is.

  • Author

We won't know that until you tell us what it is.

Good point - the formatting is text, fill and border colour. In the help though, I can't find any attributes within the function that refer to any formatting at all, only dimensions. Did I miss something?

  • Author

Thanks again guys really helpful!

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.