cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
EriSto
Helper II
Helper II

Using collection to update sharepoint column value

Hi all,

I have a PowerApp for ordering items from our storage. It's based on a Sharepoint list (yes, I know lists are limited, but so is my PowerApp knowledge 😄

Anyways, I have everything working, but there is one last operation I need to incorporate:

I have a gallery view of all of the items (rows) that are “on order”. I also have a “checkbox”, so that the user can check off the items that are sent.

The items that are “checked off” are added to a collection.

Now, in my SharePoint list I have a “Yes/No” column which is “No” on default.

I am trying to get PowerApp to patch the selected items (forementioned collection) so that the “Yes/No” value is changed to “Yes” upon pushing a button.

I don’t understand how I can get PowerApp to use my collection of items to change the value of the selected items to “yes”

1 ACCEPTED SOLUTION

Accepted Solutions
BCLS776
Super User
Super User

There are a couple of things you need to do here:

  1. Make sure when you add "checked off" records to your collection, you have also included enough other info that you can successfully LookUp that same record on your SP list afterwards. An ID value would be perfect
  2. Once you can identify your record, you can use a Patch() statement to update the record in the SP list. The basic form of the Patch() will look something like:
ForAll(myCollection As aCol,
    Patch(mySPList,
        LookUp(mySPList, ID = aCol.ID), // This identifies the record to be updated
        {
         myColumn: // Put the column's new value here
        }
    )
)

 

Hope that helps,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

View solution in original post

1 REPLY 1
BCLS776
Super User
Super User

There are a couple of things you need to do here:

  1. Make sure when you add "checked off" records to your collection, you have also included enough other info that you can successfully LookUp that same record on your SP list afterwards. An ID value would be perfect
  2. Once you can identify your record, you can use a Patch() statement to update the record in the SP list. The basic form of the Patch() will look something like:
ForAll(myCollection As aCol,
    Patch(mySPList,
        LookUp(mySPList, ID = aCol.ID), // This identifies the record to be updated
        {
         myColumn: // Put the column's new value here
        }
    )
)

 

Hope that helps,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,011)