web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Suggested Answer

Restoring old version

(0) ShareShare
ReportReport
Posted on by 10
Dear members,
 
Last week i created a flow in Flows. After some changes i received the error: The execution of template action 'For_each' failed: the result of the evaluation of 'foreach' expression '@item()?['body']?['value']' is of type 'Null'. The result must be a valid array. I don't know how to solve the problem. Can i restore my flow the version that was working?
 
 
Categories:
I have the same question (0)
  • Suggested answer
    MS.Ragavendar Profile Picture
    6,446 Super User 2026 Season 1 on at
     
    The error message clearly states that the expression needs to return an array, and it's currently returning null.
     
    If the array might sometimes be missing, you can use the coalesce function to provide a default value (an empty array) if the expression evaluates to null. 
     
    For example: coalesce(@item()?[\'body\']?[\'value\'], [])
     
    If you still need any help give the screenshots and output data accordingly .
     
    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item
     
     
  • SamLed Profile Picture
    2,340 Moderator on at
     
    Saddly, there is no way to restore previous version of a flow. You have to deal with versioning by your own. Personaly before modifing a flow, I usually make a copy using "Save as". 
     
    Then, if the flow is currently running, I work on the copy, test it, and replace the old with the new when it's good, otherwise I use the copy to keep track of how it was designed before.
     
    That works great for manual trigger flow, for automated ones and to avoid unexpected all my flows are designed using a variable "Settings" with a JSON object. Ex: 
     
     
    I never use variable for constants, only if value changes during flow execution.
     
    This way, none of my actions are hard-coded. I never use triggeroutputs directly either, I always use a Compose as an intermediary to make debugging easier, but more importantly it bring me the oppertunity to can change the triggers if needed without having to change all the references defined in the actions. So I can replace a "When a file is created or modified " trigger with a manual trigger for testing purposes. I just need to set an item ID in the Compose and set it back to the TriggerOutput ID when I switch back to the automatic trigger.
     
    Now, as you can't cancel your changes, if you want some help to debug your flow, feel free to ask. Don't hesitate to post some screen shots of you flow for better understanding.
     
    Regard,
    Sam
  • CU31030749-0 Profile Picture
    10 on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 552

#2
Valantis Profile Picture

Valantis 388

#3
11manish Profile Picture

11manish 375

Last 30 days Overall leaderboard