I am trying to use a DatePicker to select the date and time that a user wants. However the current implementation on PowerApps only seems to allow me to modify the date element and not the time.
To combat this, i am building two drop downs, one for hours and another for minutes. However, having to painstakingly right the numbers from 0 to 23 and 00 to 59 is getting rather annoying.
Does anyone know a faster, more efficient implementation of this, or if i am getting this completely wrong and there is a completely different way, please let me know.
Thanks in advance
Solved! Go to Solution.
If you have the Date and Time source column it should produce the below. You can use the syntax if you are trying to create your own date and time field. However, is there a need? Let me know if I'm off point.
A quick way is to quickly make another source list of one column as a complex type Date and Time field. SharePoint Lists allow this to be fast. Then you import that data source, and copy all the controls to your own destination. Then you can remove the datasource. Let it build that for you.
Otherwise copy the syntax directly in the controls.
Minutes Items
["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"]
Hours Items
["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"]
Update (DataCard)
DateValue2.SelectedDate + Time(Value(HourValue2.Selected.Value), Value(MinuteValue2.Selected.Value), 0)
(Its numbers so its just adding)
I cant figure anything out, other than writing them all out..
Not sure what the purpose of your app is, but if the user is perhaps booking something, you could make it go in 5,10,15 or 30 minute intervals. This will make the list far less cluttered too. In addition, you could make the hours column only run 1-12 and then have a toggle for am/pm.
If the scenario is that the user needs their exact time, you could use the Now() function
Sean
You could setup a SharePoint list/Excel spreadsheet/CSV file for the hours and another list for the minutes then bound each control to the list
MG.-
Mariano Gomez, MVP
What data source are you writing to?
Do you have a complex type date & time field in that source or are you going for a number field? Or are you trying to accomplish this using single line of text.
We are writting to Dynamics 365 on a date time field.
If you have the Date and Time source column it should produce the below. You can use the syntax if you are trying to create your own date and time field. However, is there a need? Let me know if I'm off point.
A quick way is to quickly make another source list of one column as a complex type Date and Time field. SharePoint Lists allow this to be fast. Then you import that data source, and copy all the controls to your own destination. Then you can remove the datasource. Let it build that for you.
Otherwise copy the syntax directly in the controls.
Minutes Items
["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"]
Hours Items
["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"]
Update (DataCard)
DateValue2.SelectedDate + Time(Value(HourValue2.Selected.Value), Value(MinuteValue2.Selected.Value), 0)
(Its numbers so its just adding)
Yeh, this was what i built the drop downs off of. However the process we are reproducing requires a slightly different approach to this. Rather than getting users to fill out forms directly, we are getting them to fill out questions which then get mapped to the forms hidden elsewhere on powerapps. This is so we can ensure we can match the data that is already in existinance within CRM.
Thanks for your help!
Sounds interesting. Give us a bell if allowed
Just updates the post with the syntax so you can copy and paste
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
199 | |
52 | |
41 | |
39 | |
35 |
User | Count |
---|---|
263 | |
86 | |
71 | |
69 | |
66 |