cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Fa1con74
Helper III
Helper III

displaying a field according to the value of a toggle button

Hello,

 

I want to display some fields only if my toggle button is enabled

So I put in visible of my screen :

 

UpdateContext({aVisible: false})

 

In the visible of my fields

 

aVisible

 

And in visible from my toggle button

 

Switch(DataCardValue50.Value;true;UpdateContext({aVisible:true});UpdateContext({aVisisble:false}))

 

But it doesn't work and I don't understand why 🤔?

1 ACCEPTED SOLUTION

Accepted Solutions
AJ_Z
Super User
Super User

change the visible of the toggle back to true as the switch to update the variable should not be there 🙂

 

Now there are two ways to do the next step the first is this:

make the OnChange Property this:
UpdateContext({aVisible:Self.Value})
this is the quickest way

 

the other way is to make the 
OnCheck Property this:
UpdateContext({aVisible:true})

and the OnUnCheck property this:
UpdateContext({aVisible:false})



Signature:


If you appreciated my comments/responses please be sure to Like/Kudo them it really does make me smile 🙂 !
Link to the Power Platform Professionals United Kingdom User Group:

https://powerusers.microsoft.com/t5/Power-Platform-Professionals/gh-p/PowerPlatformProfessionalsUnit...

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @Fa1con74 ,'

Assuming DataCardValue50 is your toggle control, the Visible of your controls simply needs to be

DataCardValue50.Value

If you want to keep running with the Variable, do this

UpdateContext({aVisible:DataCardValue50.Value})

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

AJ_Z
Super User
Super User

change the visible of the toggle back to true as the switch to update the variable should not be there 🙂

 

Now there are two ways to do the next step the first is this:

make the OnChange Property this:
UpdateContext({aVisible:Self.Value})
this is the quickest way

 

the other way is to make the 
OnCheck Property this:
UpdateContext({aVisible:true})

and the OnUnCheck property this:
UpdateContext({aVisible:false})



Signature:


If you appreciated my comments/responses please be sure to Like/Kudo them it really does make me smile 🙂 !
Link to the Power Platform Professionals United Kingdom User Group:

https://powerusers.microsoft.com/t5/Power-Platform-Professionals/gh-p/PowerPlatformProfessionalsUnit...

gyanchandkabra
Regular Visitor

Hi, 

 

On the Visible property of the field for which you want to hide and show, you can directly specify the ToggleField.Value or if(ToggleField.Value, True, false).

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,046)