Skip to main content
briant79931025
Participant
Dec 26, 2018 4:23 PM UTC
Answered

Conditional Formatting calculations

Good morning,

I have a form that contains two user input fields: Severity (A-E entry) and Likelihood (1-5 entry). I would like to have a third field autopopulate a response based on the user entries.

For example: User enters C in Severity and 4 in LIkelihood the autopopulated response would be H1.

The autopopulated response comes from a risk matrix I have created.

Is this possible through some sort of script?

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Dec 26, 2018 5:01 PM UTC

Sure. You can use something like this as the custom calculation script of that field:

var severity = this.getField("Severity").valueAsString;

var likelihood = this.getField("Likelihood").valueAsString;

if (severity=="C" && likelihood=="4") event.value = "H1";

else if (severity=="C" && likelihood=="3") event.value = "B1";

else if (severity=="B" && likelihood=="4") event.value = "H2"; // etc.

else event.value = "";

3 replies

briant79931025
Participant
Dec 26, 2018 5:12 PM UTC

thank You. I found the issue and your solution worked.

Translate
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Dec 26, 2018 5:01 PM UTC

Sure. You can use something like this as the custom calculation script of that field:

var severity = this.getField("Severity").valueAsString;

var likelihood = this.getField("Likelihood").valueAsString;

if (severity=="C" && likelihood=="4") event.value = "H1";

else if (severity=="C" && likelihood=="3") event.value = "B1";

else if (severity=="B" && likelihood=="4") event.value = "H2"; // etc.

else event.value = "";

Translate
briant79931025
Participant
Dec 26, 2018 5:10 PM UTC

Thank you. However, I have tried this and nothing is being populated in the result field, which is titled ORA.

Translate