TL;DR: Add the safe navigation operator
?(e.g.item()?['id']) so missing properties return null instead of crashing your flow.
💡 Challenge
When working with Power Automate and dealing with objects or arrays, you often come across expressions like item()['id']. But what if id is not always present in each item? A missing property makes your flow throw an error and fail.
✅ Solution
Use the safe navigation operator ?, for example item()?['id']. It ensures that even if id is missing in some items, your flow won’t crash. Instead of an error, it returns null, which is a lifesaver when your data isn’t always consistent.
🔧 How It’s Done
1. Spot the risky reference
🔸 Find expressions such as item()['id'], body('Action')['value'] or triggerBody()['field'] that assume a property always exists.
2. Add the safe navigation operator
🔸 Insert ? before the bracket: item()?['id'].
🔸 The expression now returns null instead of failing when the property is missing.
3. Handle the null case
🔸 Use coalesce(item()?['id'], 'default') or a Condition to react to missing values gracefully.
🎉 Result
Your flows keep running even when incoming data is inconsistent, returning null instead of throwing errors, far more robust and easier to maintain.
🌟 Key Advantages
🔸 Prevents runtime errors from missing properties
🔸 Returns a predictable null you can handle explicitly
🔸 Minimal effort, just one character per reference
🎥 Video Tutorial
🛠️ FAQ
Q: What is the safe navigation operator (?) in Power Automate?
The safe navigation operator (?) prevents runtime errors when accessing properties that may not exist on an object or array element, returning null instead of throwing an error.
Q: When should I use item()?['property'] instead of item()['property']?
Use item()?['property'] whenever a property might be missing or undefined, so your flow doesn’t fail and handles missing values gracefully.
Q: Will using the safe navigation operator affect performance?
No. It has minimal performance impact and greatly improves the stability of your flows by avoiding unnecessary errors.