I'm VERY new to Powerapps.
My data has integer values that are being used for 0 or 1 (no other values.)
The toggle switch wants a binary value.
How can i convert the reading and writing to binary to be able to work with this data type? Looking for some type of convert function.
It depends on whether the Toggle control is inside or outside the Gallery.
Here is an example of outside:
Default
property to:(Long-form code shown)
If(
glrSampleData.Selected.dataValue = 0, false,
glrSampleData.Selected.dataValue = 1, true
)
There are some clean up items you'd want to enable here as well.
Example:
false
so you'll want to prevent any data collection from being submitted, etc. Unless the value has been explicitly set by the user.To hide the Toggle control if the Gallery has no selected record:
OnStart
property of the App control to:Set(varResetGallery, {});
Set(varResetGallery, Blank());
Set(varResetGallery, {})
Visible
property of the Toggle control to:(Again, long-form code shown)
If(
IsBlank(glrSampleData.Selected),
false,
true
)