Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
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

  • Verified answer
    Pstork1 Profile Picture
    65,991 Most Valuable Professional on at
    Re: Flow is failing

    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.

  • bendg02 Profile Picture
    8 on at
    Re: Flow is failing

    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.

  • Pstork1 Profile Picture
    65,991 Most Valuable Professional on at
    Re: Flow is failing

    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
    Re: Flow is failing

    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.

  • bendg02 Profile Picture
    8 on at
    Re: Flow is failing
  • Pstork1 Profile Picture
    65,991 Most Valuable Professional on at
    Re: Flow is failing

    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.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,631 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,991 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow