Send email activity if one email is null
Hello,
I'm trying to use the send email activity to send reports to emails that are inputted into a Survey123 form and read out of that json. If ALL 3 emails boxes are filled out, it works. But if one email is missing it erros the whole activity and no one gets an email. Can anyone else me with another activity or expression I need to try to filter out the nulls? Thank you!
Shelley
-
I think this question would be better posted in this section: https://support.vertigis.com/hc/en-us/community/topics/11497311428114-VertiGIS-Studio-Workflow
That said, do you have a (small) sample workflow which replicates your problem?
0 -
I do apologize for that, I thought I had posted it in that section!
The WF is being triggered from a S123 webhook. Here is a screenshot of the WF. I've also included a screenshot of the json when the 3rd email is null.
0 -
Sounds like you are hitting a null reference issue, which ought to have borne out in the dev console (if you haven't I highly recommend learning to debug workflow with the browser console, there's a good primer in the documentation).
I like to use ternary expressions to handle this, but for you I'd start with just doing a Falsy check (or 3) in an IF activity before each relevant section of code.
I.E.: IF there is a contractor 1, do their stuff & send them an email then move on, else do nothing and move onto the next activity. IF contractor 2… et. cetera.
0
Please sign in to leave a comment.
Comments
3 comments