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

Re: Update sharepoint list from Collection

 

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

6 REPLIES 6
Super User
Super User

Re: Update sharepoint list from Collection

@JensSeiger,

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

JensSeiger
Frequent Visitor

Re: Update sharepoint list from Collection

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

Re: Update sharepoint list from Collection

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?

JensSeiger
Frequent Visitor

Re: Update sharepoint list from Collection

No. It is a single line.
Super User
Super User

Re: Update sharepoint list from Collection

@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.

JensSeiger
Frequent Visitor

Re: Update sharepoint list from Collection

 

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

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (6,125)