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

Update list on Toggle change

This should be fairly simple but I just can't find the right answer.

I have Detail Screen where there is a toggle that I want to update the connected sharepoint list when switched. The field in the list is already Yes/No. Default is No. So switching the toggle to true should change it to Yes.

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Krcmjaster 

If this is in a Form, then you need not do anything else but submit the form.

 

If you have a stand-alone toggle control, then you can add a formula such as this to the OnCheck action of the Toggle:

   UpdateIf(yourDataSource, yourRecordCriteria, {yourYesNoColumn: true})

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

5 REPLIES 5
RandyHayes
Super User
Super User

@Krcmjaster 

If this is in a Form, then you need not do anything else but submit the form.

 

If you have a stand-alone toggle control, then you can add a formula such as this to the OnCheck action of the Toggle:

   UpdateIf(yourDataSource, yourRecordCriteria, {yourYesNoColumn: true})

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Drrickryp
Super User
Super User

@Krcmjaster 

Yes/No columns in SharePoint are buggy.  Change it to a single line of text and the toggle will save either true or false in your column. You can change the display on the toggle to "Yes" and "No" for the user but it won't change what is saved.    

RandyHayes
Super User
Super User

@Drrickryp 

Yes/No columns are perfectly fine unless you are using them for Filtering.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Drrickryp
Super User
Super User

@RandyHayes 

I entirely agree with you.  I like to keep things as simple as possible for new developers and in my recoomendations, I try to anticipate problems that they may encounter down the line with filtering on yes/no, choice and lookup fields in SharePoint. 

RandyHayes
Super User
Super User

@Drrickryp 

Agree to keep it simple!!  PowerApps design is so much easier when not overcomplicated.

Choice and LookUp columns are pretty well supported these days, but I tend not to ever use them if I can because it's usually a few more bits that I don't then have to deal with.

I use Yes/No columns often, but ONLY when there is no need for filtering or tri-state (i.e. yes/no/null).  My next choice for replacing them is to a numeric column - 0 = null, 1= false, 2=true  Those filter nicely and can be used for tri-state scenarios. 

Your mileage may vary...

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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 (1,797)