cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
remariu
Advocate I
Advocate I

Checkbox Default not recognizing item value

I have a checkbox in which I want the default value to be pulled from a SharePoint List item.  I have a Gallery set up and upon selection of the item, I set the following variable: Set(varRecord, ThisItem).  I have several fields (not in a form) that I want to populate with the SharePoint column values associated with this record.  One of the columns is populated with "Yes"/"No", and I want a checkbox to either show as true (checked) if the Item value is "Yes" and the opposite for "No."

 

I have the Default property set as follows:

 

If(varRecord."column_name" = "Yes", true, false)

 

But this is not working.  It seems to be "remembering" the last values from a previous selection and ignoring this expression.  I have confirmed that varRecord."column_name" is pulling the correct value, but the checkbox is not displaying it.

 

Any help would be greatly appreciated!

 

Thanks!

Renee

1 ACCEPTED SOLUTION

Accepted Solutions
JR-BejeweledOne
Super User
Super User

Try this:   If there are no spaces in your column name it shouldn't need "" around it.

 

Switch(
   varRecord.column_name,

      "Yes",
         true,

      "No",
         false
)

  



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

View solution in original post

3 REPLIES 3
JR-BejeweledOne
Super User
Super User

What type of column is the Yes/No column in the SharePoint list?



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

It’s a text field. 

JR-BejeweledOne
Super User
Super User

Try this:   If there are no spaces in your column name it shouldn't need "" around it.

 

Switch(
   varRecord.column_name,

      "Yes",
         true,

      "No",
         false
)

  



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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