I have a small app /form with a date text field which locks in the current date (syntax: Text(Today(), DateTimeFormat.ShortDate). Once the form is submitted it triggers a Power Automate workflow which writes all necessary info in a SharePoint list. I use the DateTimeZone.Local on the Date picker , but for some users, since they have a different time format (such as dd.mm.yyyy) it fails to write the information in the SharePoint list since it expects a specific format (mm/dd/yyyy). Tried also with DateTimeZone.UTC and converting the time zone in the Power Autoamte workflow, but it always shows yesterday's date.
Any ideas?
Solved! Go to Solution.
Hi @XAEA12
In Power Automate, in your SelectedDate variable, try the following:
Does this work?
Kind regards,
Fabian
Hi @XAEA12
Date fields can be a bit tricky due to the different time zones and the time (not date) stamp that is being submitted as well. For me its also always a try and error... 🙂
Does it work if you try the following?
DateAdd(Today(),-TimeZoneOffset(),Minutes)
For troubleshooting purposes, if you add your date to a label, you might see that it actually sets the date to midnight. Often times this will then be the next day.
Besides above, try to add your date with the Date function. Like so:
Date(Text(Today(),'yyyy'), Text(Today(),'mm'),Text(Today(),'dd'))
// alternatively, you can also do this:
Date(Year(Today()), Month(Today()), Day(Today()))
I hope this helps.
Kind regards,
Thanks for your input. Tried both ways, with no luck.
The date format looks ok visually, but when it's passed into a variable to Power Automate the format is still faulty. I made a few screenshots.
Date Picker settings:
Displayed date in the app:
The variable in Power Automate sent from the App:
Hi @XAEA12
In Power Automate, in your SelectedDate variable, try the following:
Does this work?
Kind regards,
Fabian
Hi @XAEA12 ,
Could you tell me:
Has the problem been solved?
Is there anything else I can help?
If your problem has been solved, please consider accept user’s post as a solution to help others. Thanks.
Best Regards,
Wearsky