Conditional Formatting calculations

New Here ,
Dec 26, 2018

Copy link to clipboard

Copied

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?

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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 = "";

TOPICS
Acrobat SDK and JavaScript, Windows

Views

110

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Conditional Formatting calculations

New Here ,
Dec 26, 2018

Copy link to clipboard

Copied

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?

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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 = "";

TOPICS
Acrobat SDK and JavaScript, Windows

Views

111

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Dec 26, 2018 0
Most Valuable Participant ,
Dec 26, 2018

Copy link to clipboard

Copied

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 = "";

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 26, 2018 1
New Here ,
Dec 26, 2018

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 26, 2018 0
New Here ,
Dec 26, 2018

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 26, 2018 0