Copy link to clipboard
Copied
I am trying to create a java script to auto populate a yes or no value in one field based on a value in another field. I tried the following script, but it did not work:
if(Depth To Water ft2 <= 20.20) { Submerged YN2 = "Yes"; } else { Submerged YN2 = "No"; }
Copy link to clipboard
Copied
Use this code as the custom calculation script of "Submerged YN2":
var v = Number(this.getField("Depth To Water ft2").valueAsString);
event.value = (v<=20.20) ? "Yes" : "No";
Edit: fixed the code a bit...