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

How to update SP list item using check box

Hello,

 

I have an SP list with data input from another PowerApps.

I want to create another app to update the existing items in the SP list.

 

Capture.PNG

 

on the gallery, when the checkbox is checked, then click the "pickup" button, it will update "Date & Time Column" and replace the "State" column from awaiting to done Text

 

can anyone help me with this?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @FortySixty ,

The below should work - note I have removed the EditRecord Variable as you now have a table (multiple records) patched rather than a single record.

UpdateContext({isloading : true}); 
ForAll(
   Filter(
      Gallery1.AllItems,
      CheckboxName.Value
   ) As aPatch,
   Patch(
      'SPlistName', 
      {ID:aPatch.ID}, 
      {
         State: "Done", 
         'Pickup Time': Now()
      }
   )
); 
UpdateContext({isloading : false})

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

5 REPLIES 5
BCLS776
Super User
Super User

It looks like you are using a gallery, so try this:

ForAll(Gallery1.AllItems,
    If(Checkbox1.value,
        Patch(mySPList,
            ID = ThisRecord.ID,
            {
                State: "Done",
                TimeStamp: Now()
             }
        )
    )
);
_________________________________________________________________________________________
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.
WarrenBelz
Super User
Super User

Hi @FortySixty ,

You will need to replace this with your values

If(
   GalleryName.Selected.CheckBoxName,
   Patch(
      SPListName,
      {ID:GalleryName.Selected.ID},
      {
         YourDateTimeField:Now(),
         State:"Done"
      }
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

I managed to use the below formula;

 

UpdateContext({isloading : true}); UpdateContext({EditRecord:Patch('SPlistName', LookUp('SPlistName',ID=Gallery1.Selected.ID), {State: "Done"}, {'Pickup Time': Now()})}); UpdateContext({isloading : false})

 

but it only works for one selection of the checkbox, can you help me to add multiple selection in  the formula?

Hi @FortySixty ,

The below should work - note I have removed the EditRecord Variable as you now have a table (multiple records) patched rather than a single record.

UpdateContext({isloading : true}); 
ForAll(
   Filter(
      Gallery1.AllItems,
      CheckboxName.Value
   ) As aPatch,
   Patch(
      'SPlistName', 
      {ID:aPatch.ID}, 
      {
         State: "Done", 
         'Pickup Time': Now()
      }
   )
); 
UpdateContext({isloading : false})

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

@WarrenBelz it works, thank you so much

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,745)