cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Ardian
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. 

 

Thanks

1 REPLY 1
Super User
Super User

Re: Get the ID ForAll patch collection

@Ardian 

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

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,741)