Hi,
I have a power app form linked to SharePoint list. One of the cards Is a date and time picker.
i have managed to set the date to current date if the form is new but use parent default if editing.
what I would like to achieve is to set the hour and mins to current time if the form is in new mode, however if the form is in edit I would just like the previously selected values to remain.
time format would need to be 24 hour.
@Jimbobrich
On DatePicker DefaultDate use this:
If(
Form1.Mode = FormMode.New,
DateTimeValue(Text(Today(), "yyyy-mm-dd")),
Parent.Default
)
On Hours Dropdown Default property use:
If(
Form1.Mode = FormMode.New,
Hour(Now()),
Text(Hour(Parent.Default),"00")
)
and On Minitues Dropdown Default property use:
If(
Form1.Mode = FormMode.New,
Minute(Now()),
Text(Minute(Parent.Default),"00")
)
If this is the answer for your question, please mark the post as Solved.
If this answer helps you in any way, please give it a like.
Thanks!
Hi,
Sorry, I'm still learning with powerapps, should the formula be entered in the default on the data card?
I dont seem to be able to get any solution to work, obviously this is user error on my behalf.
@Jimbobrich ,
can you try this:
If(
FormMode() = FormMode.New,
DateTimeValue(Text(Today(), "yyyy-mm-dd") & " " & Text(Now(), "[$-en]HH:mm")),
Parent.Default
)
If this is the answer for your question, please mark the post as Solved.
If this answer helps you in any way, please give it a like.
Thanks!
Hi @SpongYe
I have tried the above but this hasn't had the desired impact. When I create now or edit I just get a blank value.
I have used the above formula on the date and it has worked perfectly, obviously changing Now() for Today().
I'm at a loss of how to resolve this.
Hi @Jimbobrich
In the formula bar of the Time Picker, set the Default to:
If(
FormName.Mode = FormMode.New, // replace FormName with the name of your form
Now(),
Parent.Default
)
If you have any questions or feedback, please let me know. Have a great day! 😊
-----------------------
PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]
I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2