cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
kbansal
Level: Powered On

Make all the field view only when toggle is true

Hi,

 

I've a tabbed form and every tab has a toggle. How can I make the fields of a tab view only if the toggle value i true?

 

In the screenshot below, I want to make the Intake tab and the field from second tab view only if the toggle value is true.

 Screen 1.png

 

Also, I want to mention my tabs are not separate button. They are different items button from the gallery.

 

Thanks,

 
 
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Make all the field view only when toggle is true

Hi @kbansal ,

Could you tell me do you want to change a control's mode between edit and view or change a control's visible?

Firstly, you could set a variable as @Eelman  said.

Toggle.OnCheck = UpdateContext({someVariableName: true})

 

Toggle.UnCheck = UpdateContext({someVariableName: false})

Then, set the control's mode or Visible.

If you want to change its mode between edit and view, then you need to set its DisplayMode to this variable.

If you want to change its visible, then you need to set its Visible to this variable.

What's more, do you mean that your tabs are items in a gallery?

In gallery, you can not use visible to decide an item whether display.

I suggest you use filter function.

Set the gallery's Items: 

If(someVariableName,Filter(table, Not(fieldname="intake")),table)

 

 

Best regards,

Community Support Team _ Phoebe Liu
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
Eelman
Level 8

Re: Make all the field view only when toggle is true

Toggle.OnCheck = UpdateContext({someVariableName: true})

 

Toggle.UnCheck = UpdateContext({someVariableName: false})

 

Then, for all the controls you wish make View/Edit:

 

YourControl.DisplayMode = If( someVariableName, DisplayMode.View, DisplayMode.Edit)

 

I think some logic along these lines should work for you

Community Support Team
Community Support Team

Re: Make all the field view only when toggle is true

Hi @kbansal ,

Could you tell me do you want to change a control's mode between edit and view or change a control's visible?

Firstly, you could set a variable as @Eelman  said.

Toggle.OnCheck = UpdateContext({someVariableName: true})

 

Toggle.UnCheck = UpdateContext({someVariableName: false})

Then, set the control's mode or Visible.

If you want to change its mode between edit and view, then you need to set its DisplayMode to this variable.

If you want to change its visible, then you need to set its Visible to this variable.

What's more, do you mean that your tabs are items in a gallery?

In gallery, you can not use visible to decide an item whether display.

I suggest you use filter function.

Set the gallery's Items: 

If(someVariableName,Filter(table, Not(fieldname="intake")),table)

 

 

Best regards,

Community Support Team _ Phoebe Liu
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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,380)