web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Showing Date Picker wh...
Power Apps
Answered

Showing Date Picker when any value is selected in Radio button

(0) ShareShare
ReportReport
Posted on by 26

Hi, i have a couple of questions regarding an app that i am building for a class.

 

First off, i have a Radio button with the question "Are you visiting for more than 1 day?" with "Yes" or "No" as the possible values.

If "No" is selected, DatePicker1 becomes visible. It is currently set up like this:

If(Radio1.Selected.Value = "No"; true; false)

 

If "Yes" is selected, i would still like for DatePicker1 to become visible (so it becomes visible if either option is chosen), as well as another DatePicker(2) - i understand how to make them visible if either Yes or No is chosen, but how can i make DatePicker1 show up either way?

 

If there is a better way to make a "From date / To date" setup, any help is appreciated.

 

Question 2:

I am using a Patch function to save the input from a number of questions, but as i have two DatePickers in the app, both dates are being saved, even though only one of them is visible.

Is it possible to make the field in DatePicker2 blank whenever it is not visible?

 

I hope the questions make sense, and thanks in advance

 

Categories:
I have the same question (0)
  • Verified answer
    mmollet Profile Picture
    3,187 on at

    Question 1: If you always want your Datepicker1 to be visible you could always just make it true and it will always be after that. If you want it visible once one of the radios is selected then you can use the following:

    If(Radio1.Selected.Value = "No" Or Radio1.Selected.Value = "Yes", true, false)

    This will make it true if No or Yes is selected and false if it is blank i.e. neither is selected. The default is set to "" i believe by default so if that doesn't work then you can try chaning that to Blank() as well.

     

    Question 2: For your column I will call "EndDate" you can use something like this: 

    If(Datepicker2.visible, Datepicker2.selecteddate, Blank())

    This will patch the date in datepicker2 if the visible property is true and will patch blank if it is not.

  • VBL Profile Picture
    26 on at

    Perfect, that was nice and simple - thanks for the quick reply 🙂

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard