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

Update sharepoint list from Collection

I have created an powerapp where I use the SharePoint List ID as a data entry to a collection - Based on that I would like to submit the collections by ID and update a text field to a constant "Delivered" - but nothing gets updated. Any help would be great. 

 

Entry field "Type=Number"

OnChange: Collect(ScanDel, {ID: Deliver.Text, Status_Txt: "Delivered"}); Reset(Deliver)

 

Submit: ForAll(ScanDel, Patch('SHPLIST', First(Filter('SHPLIST', ID = ScanDel.ID)) , {Status_Txt:"Delivered"}))

 

1 ACCEPTED SOLUTION

Accepted Solutions

 

I figured it out. I needed to call the value of the field in the collection.  My warning showed me that I can't compare text with a value. 

That means I changed the collect to:

 

Collect(ScanDel, {ID: Value(Deliver.Text), Status_Txt: "Delivered"}); Reset(Deliver)

View solution in original post

7 REPLIES 7
Drrickryp
Super User
Super User

@JensSeiger,

Your patch function syntax looks correct. You would put it as the OnSelect property of an icon or button to run it.

Thank you for your fast reply. The Submit is a butron and unfortunately not working. Any ideas? Any difference as I am using the ID?

I wouldn’t think so. To find out where the problem is, test it without the ForAll. BTW, Is the delivered field a Choice or Lookup type column in your SharePoint list?

No. It is a single line.

@JensSeiger 

The problem could be ID. You may want to try using the disambiguation operator 

ForAll(ScanDel, Patch('SHPLIST', First(Filter('SHPLIST', ID = ScanDel[@ID])) , {Status_Txt:"Delivered"})). If that works, please mark the discussion solved.

 

I figured it out. I needed to call the value of the field in the collection.  My warning showed me that I can't compare text with a value. 

That means I changed the collect to:

 

Collect(ScanDel, {ID: Value(Deliver.Text), Status_Txt: "Delivered"}); Reset(Deliver)

Thanks for this fixed my issue. disambiguation operator.

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

<
Users online (3,346)