cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dave8
Impactful Individual
Impactful Individual

How to set default selected date picker value and default selected dropdown value?

Hello,

 

How can I set default selected value of date picker control as "Today's Date" and default selected Dropdown value as blank ( "" )?

 

Note : Dropdown Values are bind with CDS entities having two items "Open & Close"

 

Thanks,

7 REPLIES 7
eka24
Super User III
Super User III

On the DatePicker DefaultDate;

Today ()

 

On the dropdown, set the AllowBlankSelection property to true. 

 

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Anonymous
Not applicable

Hi @dave8 

Date Picker: Set DefaultDate property to Today()

Dropdown Value: What are your values? If it's something like 1 to 3, then you can set the Item property as ["","1", "2", "3"] where the first one is blank.

Hope this will help 🙂 

SkiDK
Solution Sage
Solution Sage

For the datepicker you can put 'Today()' in the DefaultDate property of the datapicker. Normally if you add a datepicker, Today() should already be filled in.

For the dropdown Default property fill in 'Blank()' and also set the AllowEmptySelection property of the dropdown to 'true'.

dave8
Impactful Individual
Impactful Individual

Thank you @eka24 

 

Dropdown values and date values are working as expected, however, on button click, default values are disappearing, even if I set those values via update context on button click.

 

Basically, Date picker and dropdown, still shows the previously selected values on the button click - I want to have following on button click:

DefaultDate:Today(),DefaultStatus:Blank()

 

By changing all default properties settings, it doesn't work once value is selected and clicked on respective button.

 

any clue?

 

Thanks,

eka24
Super User III
Super User III

If I understand you, you want to set the default based on a button? If so then try

UpdateContext ({MyDateToday: Today ()})

 

Then on the DefaultDate:

MyDateToday

 

On the Dropdown button;

UpdateContext ({Drop: Blank()})

 

Then on the Default

Drop

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

dave8
Impactful Individual
Impactful Individual

Hi @eka24 

 

Your understanding is correct, however As stated earlier, I have already implemented the same and it's not working for me - did it work for you?

 

Thanks,

eka24
Super User III
Super User III

 

Give a screenshot of what you have done. Also are you using a form?

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

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,501)