web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patching an update to ...
Power Apps
Answered

Patching an update to sharepoint list.

(0) ShareShare
ReportReport
Posted on by 302

Hello. I’m trying to find the correct Patch function.  I have an gallery that when a check box is checked, it changes a Status label to “Yes” And when unchecked “No”.  I need to Update a sharepoint list with the Yes/No status.  It works just on the first checkbox checked but not update the other checkbox.  And, when I uncheck the box, the label changes to No but when I click the update button, it does not update the results on the sharepoint list. 

Timm1_0-1710451323820.png

The check box name is chckServer. Text is- This Item.Status.  Default is - If(ThisItem.Status="No",false,true)

 

The Yes/No label named lblStatus and Text is-If(chkServer.Value=true, "Yes", "No")

 

In the Update button, I have it remove the content in one list and patch to a sharepoint list from a different gallery.  Works great.  But the second patch, I want to UPDATE the Status column in sharepoint list. 

 

Button  OnSelect - RemoveIf('Server and Network Status',true);

ForAll(galEmployeeview.AllItems , Patch('Server and Network Status',Defaults('Server and Network Status'),{Title:lblServerName.Text,Description:lblDescription.Text});Patch('Server List',{ID: galServers.Selected.ID},{Status:lblStatus.Text}))

 

When I update, it updates the first checkbox Yes results but not the others. And if it changes from Yes, to No, click on Update,  it doesn’t update in the sharepoint list.  

I have also tried  Patch('Server List', galServers.Selected,{Status:lblStatus.Text}) Does not update

Do I need a Lookup function?

Thank you for your time.

Tim

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    Hi @Timm1 ,

    A bit of a guess here, but are you trying to do this ?

    Patch(
     'Server and Network Status',
     ForAll(
     galEmployeeview.AllItems As _Data, 
     { 
     Title: _Data.lblServerName.Text,
     Description: _Data.lblDescription.Text
     }
     )
    );
    Patch(
     'Server List',
     ForAll(
     galServers As _Data,
     {
     ID: _Data.ID
     Status: _Data.lblStatus.Text
     }
     )
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Timm1 Profile Picture
    302 on at

    Hi Warren.  When I put the formula in, it doesn't like the As_Data.  Here is what I have.  

    Timm1_0-1710517240062.png

    Thank you!

  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    @Timm1 ,

    There is a space between As and _Data

  • Timm1 Profile Picture
    302 on at

    Now, it is even more angry. 🙂

    Timm1_0-1710541405116.png

    And I don't know why my Format Text is greyed out.  Can you see anything else I'm doing wrong? 

    I really appreciate your time on this.   

    Tim 

  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    @Timm1 ,

    You have ID: _Data/ID instead of ID: _Data.ID  Can you please post your code in Text also

  • Timm1 Profile Picture
    302 on at

    I corrected the / to a dot.  Still red squiggly line through the whole patch formula

     

    RemoveIf('Server and Network Status',true);
    ForAll(galEmployeeview.AllItems , Patch('Server and Network Status',Defaults('Server and Network Status'),{Title:lblServerName.Text,Description:lblDescription.Text});Patch('Server List',ForAll(galServers As _Data,{ID:_Data.ID Status: _Data.lblStatus.Text}))
  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    @Timm1 ,

    Now you have left out As _Data on the first one- before you come back again, please check your code against what I have posted.

  • Timm1 Profile Picture
    302 on at

    .

  • Timm1 Profile Picture
    302 on at

    Thanks Warren.  Your solution worked. You just left out a comma between the ID: _Data.ID Status: _Data.lblStatus.Text in your code.    Once I figured that out, your code worked.  Thank you very much! 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard