Skip to main content
Participant
December 7, 2020
Question

Fillable Form Population - Conditional Formatting

  • December 7, 2020
  • 1 reply
  • 862 views

Hello, I recently created a fillable form that integrates with a Smartsheet product.  How do I apply conditional formatting to color code a text field auto populated from a different application (ie, "Red" = change fillColor to color.red, "Yellow"=change fillColor to color.yellow, etc.)

 

Any help you can provide is greatly appreciated.

 

Edwina -

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
December 7, 2020

As the field's custom calculation script you can add something like this:

if (event.value=="Red") event.target.fillColor = color.red;

if (event.value=="Yellow") event.target.fillColor = color.yellow;

etc.

If the data is imported from an external source you would need to add a command to execute all of these scripts when the file is opened, by adding this code as a doc-level script:

this.calculateNow();

Participant
December 7, 2020

Hi, thank you for the feedback.  Yes, you are correct, data is imported from an external source.  Following are the changes I made to my original script: 

Unfortunately, the fill color did not change per my criteria.  Please advise.  

try67
Community Expert
Community Expert
December 7, 2020

After importing the data you have to re-open the file.