Add color to Fields in Uipath Forms

I would like to know how we can add specific color to fields based on values on another Fields.

For example: Assume I have 2 fields,

  1. Age
  2. Approve/Reject

If the age is above 30, field 2 should be red color
if the age is less than 30, field 2 should be green color.

How can I achieve this? I am barely new to uipath forms. Please excuse if I am missing something.

I believe, adding condition based color to fields is not possible yet.

What you can do is to display a different field corresponding to the value. There can be two fields for age above than 30 and age less than 30, these two can be displayed on the basis of text entered or dropdown selected.

Yep, this is something I am doing now as a workaround. Any way we can pass css code to make the field colorful??

Yes, actually CSS can be incorporated using the HTML Element Component from the advanced components. you may give it a try and add a custom JavaScript logic to the required field to change the color. create a IF condition in JS and apply color accordingly.

All the best! Do let us know the outcome.

1 Like

Sure, thanks.

@rahulsharma Hey Rahul, I am not able to achieve this also I am not good in JS, hence probable I might have missed something.
Any idea what should be the script?
There is a field receiving input from code as RED, hence that field should be filled in RED color, similar for other colors.