cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

A toggle button for 'true'/'false' value in a gallery

Hello,

I want to create a toggle button in gallery so users can quickly change a true/false value I have a toggle with the default set as:

ThisItem.Show_Flag 

Where 'Show_Flag' is the true/false value in my SQL database.

But this doesn't get the correct value (Usually all true or all false).

 

Also, I have the Onchange value set to:

Patch('[DATA]' , First(Filter( '[DATA]' , Measure_Name=ThisItem.Measure_Name )), {Show_Flag: Toggle1_3.Value} )

I can't tell if the Onchange formula is working correctly and the default value is causing the issue or they are both wrong.

 

Any help appreciated,

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: A toggle button for 'true'/'false' value in a gallery

Hi @Connor_Taylor,

Is the Show_Flag column a Bit type column in your SQL table?

Do you mean that the Show_Flag column value could not be displayed correctly within your Gallery?

I suppose that you created a Bit type column in your SQL table to store your Show_Flag value, is it true?

I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:

The data structure of my SQL table as below:12.JPG

NoteThe Show_Flag column is a Bit type column in my SQL table.

App's configuration as below:11.JPG

Set the OnChange property of the Toggle control within the Gallery to following:

Patch(
'[dbo].[TaskLists]',
ThisItem,
{
Show_Flag: Toggle1.Value
}
)

Please check if you have used proper data type to store the Show_Flag column value (True/False value) within your SQL table. Please consider take a try to use Bit type column to store your Show_Flag column value.

You could also consider take a try to add a Label control within your Gallery, set the Text property to following:

ThisItem.Show_Flag 

then check if the Label control show correct True/False value within your Gallery.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: A toggle button for 'true'/'false' value in a gallery

Hi @Connor_Taylor,

Is the Show_Flag column a Bit type column in your SQL table?

Do you mean that the Show_Flag column value could not be displayed correctly within your Gallery?

I suppose that you created a Bit type column in your SQL table to store your Show_Flag value, is it true?

I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:

The data structure of my SQL table as below:12.JPG

NoteThe Show_Flag column is a Bit type column in my SQL table.

App's configuration as below:11.JPG

Set the OnChange property of the Toggle control within the Gallery to following:

Patch(
'[dbo].[TaskLists]',
ThisItem,
{
Show_Flag: Toggle1.Value
}
)

Please check if you have used proper data type to store the Show_Flag column value (True/False value) within your SQL table. Please consider take a try to use Bit type column to store your Show_Flag column value.

You could also consider take a try to add a Label control within your Gallery, set the Text property to following:

ThisItem.Show_Flag 

then check if the Label control show correct True/False value within your Gallery.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Resolver I
Resolver I

Re: A toggle button for 'true'/'false' value in a gallery

Everything works perfect now

Thank you @v-xida-msft

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (8,365)