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
Super User

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,

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,

 

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,038)