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

Enable Date Picker When Toggle is Moved

Hello,

 

I currently have a disabled date picker that need to be enabled once a user moves a toggle.  When the Completed_Toggle field is moved to yes, I would like the Date Request Completed_Input date picker field to return to edit mode.  Does anyone have a solution for this?  Thank you.

k_cain_0-1610058598005.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Jeff_Thorpe
Super User
Super User

If your toggle is named "Completed_Toggle" then the formula would look like this:

If(Completed_Toggle.Value, DisplayMode.Edit, DisplayMode.Disabled)

 

Unless I have a typo I think you can copy/paste the formula above into the DisplayMode property formula bar.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

7 REPLIES 7
Jeff_Thorpe
Super User
Super User

In the DisplayMode property of the Date picker you can a formula like this?

 

If(Toggle1.Value, DisplayMode.Edit, Disabled)

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Jeff, I tried that, but I am still getting an invalid argument type message.

Can you share the a screen shot of the formula with the error?



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Jeff,

Below is a screenshot of the error. The red "X" indicated invalid argument type.

k_cain_0-1610129498141.png

 

Jeff_Thorpe
Super User
Super User

It looks like toggle1 may not be the name of the toggle control. Also since the toggle returns true or false you don't need the "= true". Now this part won't cause an error, so take a look at the toggle and use that control name.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

The name of the toggle is Completed_Toggle, and the TrueText of the toggle is "Yes".  I also tried this formula, but it didn't work either:

k_cain_0-1610132086984.png

 

Jeff_Thorpe
Super User
Super User

If your toggle is named "Completed_Toggle" then the formula would look like this:

If(Completed_Toggle.Value, DisplayMode.Edit, DisplayMode.Disabled)

 

Unless I have a typo I think you can copy/paste the formula above into the DisplayMode property formula bar.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (3,184)