Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Display text in a field based upon a number range in another field.

Avatar

Level 1

Hi I am trying to make a simple grade field for a form that displays a grade based upon a number range in another field.

for if the total field (calculated) is 100-200 grade d, if its 200-300, grade c, ect..

if (tQCAs.rawValue <= 117) {

     tQCAf.rawValue = "F - Unacceptable";

}

else if (tQCAs.rawValue = 118-176) {

     tQCAf.rawValue = "D - Needs Improvement";

}

else if (tQCAs.rawValue >= 300) {

     tQCAf.rawValue = "B - Good";

}

else {

     tQCAf.rawValue = "NA";

I tried this but it returned an error when calculated.

Anyone got an Idea how to make this work?

Im sure theres just some operator or combination of AND or WITH I'm missing here or maby im going about it the wrong way.

1 Reply

Avatar

Level 4

You should use the below code:

if(this.rawValue <= 117)

     tQCAf.rawValue = "F - Unacceptable";

else

if (this.rawValue >=118 && this.rawValue<300)

     tQCAf.rawValue = "D - Needs Improvement";

else

if (this.rawValue >= 300)

     tQCAf.rawValue = "B - Good";

else

     tQCAf.rawValue = "NA";

~Vipin