Skip to main content
Participant
May 1, 2025 10:16 PM UTC
Answered

How to add calculations if a field "a" states Yes, then enter Field "b" into field "c" calculations

I'm trying do a If, Then statement in Adobe.  I have items numbered and I have a drop-down box with "Yes" or "No" to selected.  I like to do a calculations that if Field "SplitYN1" equals "Yes" then to enter the Item number from field "Item#1#0" into antoher field "ItemSplit1".  Can someone give me step by step on what to enter and where?

Nesa Nurani
Nesa NuraniCorrect answer
Community Expert
May 2, 2025 6:07 AM UTC

Select 'Prepare form' tool, right click on "ItemSplit1" field and select 'Properties', then select 'Calculate' tab and as 'Custom calculation script' enter this:

var itemN = this.getField("Item#1#0").value;
var drop = this.getField("SplitYN1").valueAsString;

if(drop == "Yes")
 event.value = itemN;
else
 event.value = "";

4 replies

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
May 2, 2025 6:07 AM UTC

Select 'Prepare form' tool, right click on "ItemSplit1" field and select 'Properties', then select 'Calculate' tab and as 'Custom calculation script' enter this:

var itemN = this.getField("Item#1#0").value;
var drop = this.getField("SplitYN1").valueAsString;

if(drop == "Yes")
 event.value = itemN;
else
 event.value = "";
Translate
Participant
May 2, 2025 4:11 PM UTC

Thank you, but it is still not working.  For the "Yes" and "No" question I am using a drop-down list.  Is there a different component I need to use? Such as List Box or something else?

Translate
Participant
May 2, 2025 4:17 PM UTC

The item number from "Item#1#0" is not showing up in field "ItemSplit1" if "SplitYN1" shows yes.

Translate