cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GCuva
New Member

Switch visibility

Good Afternoon.

 

Sory for my English. I wanted to make an inquiry.

 

I have a Y/N switch, i want two date/time fields to be visible when it is at 1 and when it is at o they are not visible.

 

Try the following command line:

 

IF(DataCardValue22.Value = 1, dataValue4.Visible = 1)

 

But it does not work. Could someone tell me how to continue ?

 

From already thanks you very much.

Greetins from Argentina.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@GCuva 

You cannot "set" the properties of a control in PowerApps.

What you will want to do is to go to the Visible property on the controls that you wish to make visible or not and put this formula:

    DataCardValue22.Value = 1

If the Value of your DataCardValue22 is 1, then this will be "true", thus your control Visible will be "true" and will be visible.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

6 REPLIES 6
RandyHayes
Super User
Super User

@GCuva 

You cannot "set" the properties of a control in PowerApps.

What you will want to do is to go to the Visible property on the controls that you wish to make visible or not and put this formula:

    DataCardValue22.Value = 1

If the Value of your DataCardValue22 is 1, then this will be "true", thus your control Visible will be "true" and will be visible.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Yes, sorry.

 

What I want is to make the date/time fields visible when the siwtchs is "true". Is this possible ? In what way could i do it =

 

I attach some images to make it clearer.

 

Screenshot_1.jpg

Screenshot_2.jpg

Screenshot_3.jpg

   

@GCuva 

I assume by switch you mean the Toggle control.

 

If so, then same thing...just set the visible property of the controls  you want to change visibility on to:

    yourToggleControlName.Value

 

If the toggle is on, then the controls will be visible.  If not, then they will not.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

I think you are very close. On the Visible property of Martes Hi and Martes HF Data Cards, you need If('Martes SN' = true, true, false), where Martes SN is the name of your Y/N toggle.

 

This is saying "if the toggle is set to true, make the data card Martes HI and Martes HF visible, otherwise make them not visible"

@LooseChippings 

You will need to check the "Value" of the control - 'Martes SN'.Value to get the true or false.

Also, there is no need for all the extra true and false in the visible property.

'Martes SN'.Value will be already either true or false.  There is no extra need for then return another true or false.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Thank you for all friend

 

Regards

 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (3,287)