Skip to main content

Probably a simple fix. I am expecting a value, but occassionally the data is undefined because of empty data. I would like Javascript code step to catch it instead of the zap erroring out. Any tips to use IF statement or another method to catch an undefined before it errors the code step when I use .length on it.

error when estimateid is undefined
 
current code. works fine unless the Estiamtes ID is undefined

 

Would it work in your flow to use a JS try...catch here? 


Would it work in your flow to use a JS try...catch here? 

I will give that a try, thank you!


I will have to wait to see if this will work with actual data. but THANK YOU.

 


Would it work in your flow to use a JS try...catch here? 

I will give that a try, thank you!

WORKING PERFECTLY. Thank you. Zap does not error our now, it outputs 0 if the data is undefined.