Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Patch formula help Oncheck of Checkbox

(0) ShareShare
ReportReport
Posted on by 909 Super User 2024 Season 1

Hi,

 

I am trying to update my status based on the check of a checkbox.

I want to update each record in my browsegallery every time i check the box. I want to switch the status to Complete.

 

Trying this for patch - 

Patch(['Data Source'], ThisItem.Status_two.Value, Status_two.Value = "Complete")

 

also trying this -

 

Patch(['Data Source'], ThisItem.Status_two , {Status_two:Complete})

 

where am I going wrong?

  • wonka1234 Profile Picture
    909 Super User 2024 Season 1 on at
    Re: Patch formula help Oncheck of Checkbox

    @TheRobRush  after fiddling around with it.. its working now.. thanks for your patience!!!

  • TheRobRush Profile Picture
    11,121 Super User 2025 Season 1 on at
    Re: Patch formula help Oncheck of Checkbox

    maybe just use the new gallery haha, something must be wrong with the old one. try adding the last sort part back to new one see if that breaks it or not haha 

    SortByColumns(
    	Filter(
    		'Data Source',
    		If(
    			Dropdown3.Selected.Value = "Filter for Request Status", 
    			Status_two.Value = "New Request" Or Status_two.Value = "GCO Assessment" Or Status_two.Value = "Complete", 
    			Status_two.Value = Dropdown3.Selected.Value
    		)
     And
     If(
     Filter_for_GCO_Lead.Selected.Value = "Filter for GCO Lead",
     'GCO Lead_three' = "email@gmail.com" Or 'GCO Lead_three' = "email2@gmail.com",
     'GCO Lead_three' = Filter_for_GCO_Lead.Selected.Value
     )
    		And
    		(StartsWith(
    			Control_two.Value,
    			'search box'.Text
    		)
     Or
     StartsWith(
    			ID_three,
    			'search box'.Text
    		))
    	),
    	"Title",
    	If(
    		SortDescending1,
    		SortOrder.Descending,
    		SortOrder.Ascending
    	)
    )
  • wonka1234 Profile Picture
    909 Super User 2024 Season 1 on at
    Re: Patch formula help Oncheck of Checkbox

    @TheRobRush  ok so i put the above code in the items of my new gallery, the button still works and changes the status!  tried it narrowing it briefly in my old gallery and thats still broken.. hmm..

  • TheRobRush Profile Picture
    11,121 Super User 2025 Season 1 on at
    Re: Patch formula help Oncheck of Checkbox

    Ok so lets undress it until it works. change that new gallery to 

    	Filter(
    		'Data Source',
    		If(
    			Dropdown3.Selected.Value = "Filter for Request Status", 
    			Status_two.Value = "New Request" Or Status_two.Value = "GCO Assessment" Or Status_two.Value = "Complete", 
    			Status_two.Value = Dropdown3.Selected.Value
    		)
     And
     If(
     Filter_for_GCO_Lead.Selected.Value = "Filter for GCO Lead",
     'GCO Lead_three' = "email@gmail.com" Or 'GCO Lead_three' = "email2@gmail.com",
     'GCO Lead_three' = Filter_for_GCO_Lead.Selected.Value
     )
    		And
    		(StartsWith(
    			Control_two.Value,
    			'search box'.Text
    		)
     Or
     StartsWith(
    			ID_three,
    			'search box'.Text
    		))
    	)

     

    and see if it rebreaks

  • wonka1234 Profile Picture
    909 Super User 2024 Season 1 on at
    Re: Patch formula help Oncheck of Checkbox

    Yup so when I do a vertical gallery, add a button, on select add what you have above, the status changes and is doing the correct action lol. sigh this is so confusing.

  • TheRobRush Profile Picture
    11,121 Super User 2025 Season 1 on at
    Re: Patch formula help Oncheck of Checkbox

    just to see if it changes, place a gallery in the app with just the bare sharepoint list as the source (none of the filters sorts etc) and just place a button in there that does 

    Patch('Data Source', ThisItem, {Status_two: {Value:"Complete"}})

    and see if it gives you same issue, maybe narrow down whats happening

  • wonka1234 Profile Picture
    909 Super User 2024 Season 1 on at
    Re: Patch formula help Oncheck of Checkbox

    @TheRobRush  looks okay here !

     

     

    wonka1234_1-1693340538361.png

     

  • TheRobRush Profile Picture
    11,121 Super User 2025 Season 1 on at
    Re: Patch formula help Oncheck of Checkbox

    go to your sharepoint list, in upper right click the gear symbol and click list settings, then on next screen click the name of column 'Status_two' then look in address bar to make sure column name is ACTUALLY status_two, sometimes they ar enot

     

    see image

    TheRobRush_0-1693340349302.png

     

  • wonka1234 Profile Picture
    909 Super User 2024 Season 1 on at
    Re: Patch formula help Oncheck of Checkbox

    @TheRobRush 

     

    BrowseGallery1 Items code -

     

    SortByColumns(
    	Filter(
    		[@'Data Source'],
    		If(
    			Dropdown3.Selected.Value = "Filter for Request Status", 
    			Status_two.Value = "New Request" Or Status_two.Value = "GCO Assessment" Or Status_two.Value = "Complete", 
    			Status_two.Value = Dropdown3.Selected.Value
    		)
     And
     If(
     Filter_for_GCO_Lead.Selected.Value = "Filter for GCO Lead",
     'GCO Lead_three' = "email@gmail.com" Or 'GCO Lead_three' = "email2@gmail.com",
     'GCO Lead_three' = Filter_for_GCO_Lead.Selected.Value
     )
    		And
    		(StartsWith(
    			Control_two.Value,
    			'search box'.Text
    		)
     Or
     StartsWith(
    			ID_three,
    			'search box'.Text
    		))
    	),
    	"Title",
    	If(
    		SortDescending1,
    		SortOrder.Descending,
    		SortOrder.Ascending
    	)
    )
  • TheRobRush Profile Picture
    11,121 Super User 2025 Season 1 on at
    Re: Patch formula help Oncheck of Checkbox

    what is the gallery items code

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,587 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,928 Most Valuable Professional

Leaderboard