This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
Check if a field, which might or might not exist, IsNull with the Message tool.
Avoid getting an error warning that the field doesn't exist when adding the above to a Macro.
My use case is that I'm running a Rest API call using the Download tool. It returns some XML which I pass to the XML Parse tool.
If the call is successful, then the Parse Tool outputs a "createdAt" field. If not, it doesn't.
In the Message tool I have "IsNull([createdAt])"for the test.
I'm in a catch-22. When I add this to a macro and include it in a workflow, I get a Parse Error/Warning that the field [createdAt] doesn't exist. (the workflow runs fine..but the error is confusing if I want to share the macro with coworkers)
If I use the formula tool to create the field with a null then the warning goes away....
but...the XML Parse tool checks for before create the field so it creates it as [createdAt2] which is no good.
DynamicRename won't let me remove the 2 because [createdAt] already exists.
What is the best practice for this? It seems like a common use case, no?
Personally, I would put a Filter tool after your Download or XML Parse and do a check if the call was successful in it. You will avoid errors then and will be able to configure your Message tool easily.
If after the Filter or XML Parse tool you have missing field errors, just add a field in a Text Input (just put field names, with no rows) and introduce it via Union.