If/Then Statements

New Here ,
Mar 23, 2020 Mar 23, 2020

Copy link to clipboard

Copied

I have been searching for days and trying numerous formulas found on this community but can't seem to get the custom calculation script to work.  Any help is greatly appreciated.

 

Here is the formula in Excel.   =if(Amount1>0,Type,"")

In the Type field on the bottom, I am trying to say that if the amount is greater than 0 (where 300 is) then fill in the Type from the above field that I have already entered that into.

 

Capture.PNG

 

 

 

 

 

This is what it should look like when the formula works in Excel.  Because I input JE16 in the top field, when I input the amounts in those fields below, the type JE16 shows in the first field to the left.  

Capture.PNG

I hope this makes sense and thank you in advance for any help.

TOPICS
Acrobat SDK and JavaScript

Views

45

Likes

translate

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
community guidelines
Most Valuable Participant ,
Mar 23, 2020 Mar 23, 2020

Copy link to clipboard

Copied

if (Number(this.getField("Amount1").valueAsString)>0) event.value = this.getField("Type").valueAsString;

else event.value = "";

Likes

translate

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
community guidelines
New Here ,
Mar 23, 2020 Mar 23, 2020

Copy link to clipboard

Copied

I can't thank you enough!!!

 

I was trying to use that same formula to fill in a field with a letter but only if again the amount > 0.  But there is nothing that it is pulling from so I'm not quite sure how to replace the "Type" with just the letter W.  Thank you again.

 

Likes

translate

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
community guidelines
Most Valuable Participant ,
Mar 23, 2020 Mar 23, 2020

Copy link to clipboard

Copied

Replace:

this.getField("Type").valueAsString;

With

"W";

Likes

translate

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
community guidelines