Artem Krot Posted October 14, 2021 Posted October 14, 2021 I've got a Scribe workflow problem. I'm receiving a JSON contact information object, that might or might not contain a uniqueID property. The problem is, that an IF condition, asking if this property has value, crashes, when the successfully parsed object doesn't contain this property, saying: Operation failed. Label: Parse the JSON into a Contact Object, Name: ContactFetch, Message: Field MyMapper_ContactFetch.properties.uniqueid.value, used in current Map/Flow is not a part of the failed record's data.: Ie. this is processed fine: { "firstname":"John", "lastname":"Doe", "uniqueid":"hd2h92hasd21231c1", ... } but this crashes: { "firstname":"John", "lastname":"Doe", ... } Any ideas how to fix this Can I somehow add the property if it doesn't exist before the IF step Or is there a way to set up the IF condition so that it doesn't crash, when a property doesn't exist I'm honestly supersurprised, that this is a thing - if the property doesn't exist, shouldn't it be just handled as not having a value, resp. having null value
Nick Roelandt Posted October 18, 2021 Posted October 18, 2021 Hi Artem, Since you are using the mapper activity already you can take into account an empty string in your field mappings. If you use the IF(ISNULLOREMPTY()) formula you can decide to put a default value if the Id field is empty else you provide the uniqueIdvalue coming in. thanks Nick
Artem Krot Posted October 29, 2021 Author Posted October 29, 2021 Thank you Nick, but this is useful in the next stage, in the mapping. But my workflow crashes right after beginning, after processing JSON data, basically saying: "workflow can't continue, because it wants to process an attribute which doesn't exist in the data object" and crashes. So the problem isn't really that I can't check the value when mapping it, I can't use the value in an IF condition, if it doesn't exist - because the IF condition crashes on it.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now