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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (4,382)