cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Filistyn
Helper V
Helper V

How to hide Date picker based on value of a variable

 Hey! I have a variable and on the next screen, I want to hide a Date picker if the text in the variable  is Overtime.

 

 

Set(typDovolene, "Overtime");

 

 

I just don't know how to. I have tried statements like 

 

 

EndDate.Visible = if(typDovolene.Text = "Overtime", true, false);

 

 

and it just does not work. 

 

Could anyone help?

1 ACCEPTED SOLUTION

Accepted Solutions
KvB1
Solution Specialist
Solution Specialist

You need to set the Visible property of the datepicker to:

!(typDovolene="Overtime")

View solution in original post

5 REPLIES 5
zmansuri
Community Champion
Community Champion

EndDate.Visible = if(typDovolene= "Overtime", true, false);

You don't need to use text. You are setting string in variable.

Thank you for the answer, I have tried this statement before and it still does not work. It says "Invocation of unknown or unsupported function"

KvB1
Solution Specialist
Solution Specialist

You need to set the Visible property of the datepicker to:

!(typDovolene="Overtime")

View solution in original post

Sir, you just saved my life!

 

I am an experienced C# developer, but Power apps is just really something else lol

KvB1
Solution Specialist
Solution Specialist

Yeah it takes some getting used to figuring out what controls have which properties and how to use them, luckily the 'Visible' property is identical across all controls

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

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

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,240)