Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Make all the field view only when toggle is true

(0) ShareShare
ReportReport
Posted on by

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,

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

    Hi @Anonymous ,

    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 @Anonymous  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,

  • 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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,434

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,722

Leaderboard