cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

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 III
Super User III

@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.
Check out my PowerApps Videos too!

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (31,593)