Notifications
Announcements
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
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.
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.
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.
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.
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.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Michael E. Gernaey 522 Super User 2025 Season 2
Tomac 364 Moderator
abm abm 243 Most Valuable Professional