Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

Get the ID ForAll patch collection

Hi All, 

i have created a collection called causes as follows:

ClearCollect(CausesCollection, {Cause: ""});


i then have a button where i add items to this collection from a text input. 


In the end i'm patching this to a shareoint list using the following code:

ForAll(CausesCollection, Patch(CausesList,Defaults(CausesList),{Cause:Cause}))


however when i look at CausesCollection it does not contain list item ID, i was able to create a new collection which does contain IDs as follows:

ClearCollect(CollectionOfId, ForAll(CausesCollection, Patch(CausesList,Defaults(CausesList),{Cause:Cause})))

however this just does not seem right. 


is there a different way of getting Patch ID using ForAll function?


Appreciate your help. 



Super User
Super User

Re: Get the ID ForAll patch collection


You are doing it right.  Might seem a little odd, but it is the way.  The Patch function will return the new record you create.  If you want to capture it, you need to collect it - which you are doing.


Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Helpful resources


Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020


Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (4,121)