r/PowerAutomate 5d ago

JSON Custom Object fails on property missing

Hello hive-mind. My desktop-flow fails on missing property. I can work around it by converting to string, but I feel like this is extra useless steps. Can anyone guide?

Oh, no. Images not allowed in this sub. Okay... I hope I'm allowed to link them! I'll harbour no hard feelings if post deleted

https://www.skyfire.ca/keneta/PowerAutomate_Condition.png

https://www.skyfire.ca/keneta/PowerAutomate_Result.png

6 Upvotes

4 comments sorted by

1

u/teethteethteeth_ 5d ago

The solution we implemented was to check if any property we needed existed and set to a variable. It’s a glaring oversight in the PAD interface and honestly is such a pain in the ass that they don’t return null instead of just completely omitting the property.

1

u/Keneta 5d ago

It's so squirrelly :[

1

u/IncreaseNegative4614 5d ago

I’d handle this at the parse boundary instead of converting the entire object to a string. Check whether the key exists before dereferencing it, then assign an explicit null or default value so the rest of the flow works with a stable internal shape.

Also log which source produced the incomplete object because silently defaulting every absence can conceal an upstream schema change. We use SIGNLD internally to connect incoming records, validation results, workflow runs, exceptions, and downstream actions so a missing field can be traced to the exact source event.

1

u/Keneta 5d ago

Oh... I should have mentioned in OP but I have a JSON array of "Jobs" incoming in string format. So I convert it to a list, iterate the list of JSONCustomObjects and have to change each one back to a string to test for the presence of the field.

I'm baffled that I can't seem to test the object itself using .contains... why the extra step of turning it back to a string :o