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.

Conditional formatting & processing api response

Featured Replies

I created a VAT field. Now I would like to use conditional formatting when I enter a VAT number. I want it to make the color of the text green if the VAT number exists, and make it red if the VAT number doesn't exist/wrong number.

 

To do this, I can use a calculation together with conditional formatting. However I need to send a request to an api and catch the response. Let's say it returns "1" if the VAT number was found, and a "0" if the VAT number can't be identified. Then it will be easy to handle it in the calculation. How can I talk to an API and let the conditional formatting behave according to the response? 

 

EDIT: 

Found it I think. I have an API that outputs "true" or "false" if the VAT is valid or not.

If I create a (hidden?) web viewer, and update the webview each time with the new url when I leave the VAT field. Then I can use the GetLayoutObjectAttribute to get the content of the web viewer. And if that content contains true, then should a script update the color of the VAT field with a green color, otherwise red.

 

I can execute the "Insert from URL" function in a script when I leave the field. This will insert true or false inside a hidden field. I use conditional formatting on my VAT field (green if hidden tmp field is "true" and red if "false"). 

 

I have one question left. I validate my VAT number when I leave the field, but also when I load the layout. However, when I load the layout I first have to click in a random field until the VAT field updates his conditional formatting. Any way I can refresh this field's formatting in a script? I can't let the script go to a field, because when I load the layout I don't have a field selected, and on the other hand when I'm filling in form fields I want to go to the next field after the VAT field (and not visit field #1 again).

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.