Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Text result based on calculated number

Avatar

Level 1

Hi,

I have numeric field where calculates value. I want to get a text in a text field which is based on a numeric field value. Please help me with it.

Example :

Numeric field: 100

Text field : Low

Numeric field: 200

Text field : Medium

Numeric field: 300

Text field : High

1 Reply

Avatar

Level 10

Hi,

An if/else statement would work. The following is in JavaScript in the calculate event of the TextField:

if (NumericField.rawValue == 100) {

     this.rawValue = "Low";

}

else if (NumericField.rawValue == 200) {

     this.rawValue = "Medium";

}

else if (NumericField.rawValue == 300) {

     this.rawValue = "High";

}

else {

     this.rawValue = "";

}

Hope that helps,

Niall