Skip to main content

I am getting comfortable with IF/ Then Statements in my ZAPS but I an trying to do this IF/ ELSE statement and I cannot seem to get it to work.

Verbally my statement goes like this: “If UDS is an empty cell, then the value to output is 99999 otherwise output 80307”

Code wise it looks like this:

let UDS = inputData.UDS; 
let EM = ""; // sets a blank value
if (UDS=" ") {EM = "99999";} 
else {EM = "80307";}
output = p{UDS, EM}];

 

For some reason, I cannot get the else part of this code to output the correct result.  

The issue is this: when attempting to identify an empty cell (i.e., no data), the if / then statement yields an error when using spreadsheet style formulas so I thought I would use the IF/ Else statement to get around this issue by creating an input when the correct value does not exist (so the ZAP keeps running)

Help please!!  I have diligently read all of the support materials in this Community multiple times!!

Thanks!!

 

gml

 

Hi @blueguy 

Good question.

Try changing it to this:

if (UDS == "" || UDS == null) {EM = "99999";} 

 

You can also ask ChatGPT for help with JavaScript.