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
Answered

Flow is failing

(0) ShareShare
ReportReport
Posted on by 8

I am attempting to set a field to the ID of the item when an item is added to the SharePoint list. It fails with this:

 

The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@triggerOutputs()?['body/ID']' is of type 'Integer'. The result must be a valid array.

 

https://make.powerautomate.com/environments/Default-e122af3c-4c68-4e49-9c52-4ae1e25e91ae/flows/b8af80aa-f37a-4952-b0db-7f519993a2f4

Categories:
  • Pstork1 Profile Picture
    69,661 Most Valuable Professional on at

    Why are you using a loop at this point?  The ID you are trying to add is a single Integer value. There is no need to process it as a loop.  Could you provide a screenshot of your flow? That would make it easier to tell you how to fix it.

  • bendg02 Profile Picture
    8 on at
    Flow.1.png
    Flow.2.png
    Flow.3.png
  • bendg02 Profile Picture
    8 on at

    Also, I was forced to provide values for all the required fields even though I just want to set the value of the Field "List ID' to the ID of the new list item. So, I set each required field to itself.

  • Pstork1 Profile Picture
    69,661 Most Valuable Professional on at

    So you are trying to update a set of items in another list with the ID of the item that was added. If you want to do that you need to do a get items on the second list with some kind of filter to get the items you want to update with the ID. You would then do an Apply to Each on that output. If you just want to copy the ID to the ListID field then you don't need a Loop.  Just an update item. The reason you need to fill in all the fields is because they are all marked as required in SharePoint. You can tell that by the red asterisk next to the field name in the Update Item action.

  • bendg02 Profile Picture
    8 on at

    I am now using the Update Item, but it is still expecting values in all the required fields. The user enters values for the required fields when they add the item.

    Flow1.png
  • Verified answer
    Pstork1 Profile Picture
    69,661 Most Valuable Professional on at

    I understand that, but since they are marked as required they need to be filled in each time you do an update.  So you'll need to use the current values to fill in each field when you do the update. That's why its usually not a good idea to make all the fields required.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 273 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 235

#3
David_MA Profile Picture

David_MA 172 Super User 2026 Season 2

Last 30 days Overall leaderboard