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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

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:
I have the same question (0)
  • Pstork1 Profile Picture
    68,697 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
  • 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
    68,697 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.

  • Verified answer
    Pstork1 Profile Picture
    68,697 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard