I am having some difficulty with Date/Time formats in my flow.
The Flow is triggered by PowerApps (Canvas App) and is creating events in a SharePoint calendar (classic calendar, not modern).
There are 2 parts to this flow. The first part creates the SharePoint item (Create Item action) and then the second part updates that item to set the 'AllDayEvent' flag (Send an HTTP Request to SharePoint).
In the original version of the flow, the create item was using the datepicker selected date with no additional formatting from the PowerApps collection. The calendar item was created successfully, but had a random time in each item. The update step (Send and HTTP Request to SharePoint) errors out with the error:
This is for sure a difference in the date format produced in your PowerApp and your SharePoint calendar.
1. SharePoint's settings to validate what date/time format it's expecting (for example yyyy-mm-dd or yyyy-dd-mm).
2. Check if the date is formated like that.
3. When the error occurs please check the date that is failing. The error is silent sometimes because 2020-02-01 can be the the first of February or the second of January but SharePoint will accept it since it's a valid date.
Hope this helps and makes sense.
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
I don't have any way to know which date is failing though. It could be the EventDate (Start Date) or the End Date. The error doesn't specify.
So the flow has these steps:
1. Create Item
2. Send HTTP Request (update item)
In the create item step it's using the date from the PowerApps date picker, default format. I haven't done any formatting of the date/time in the DatePicker and this is a canvas app, not a SharePoint list app.
The event is being successfully created with the date from the datepicker in the PowerApp being used for the Start and End date fields in the sharepoint calendar. This tells me that the format is correct otherwise it wouldn't be able to use it to create the event.
I am not sure where this leaves me troubleshooting wise though.
After much trial and error and searching for answers I have resolved the problem.
In the original attempt to format the date I was using a formatDateTime expression that was referring to triggerBody. This threatened to break my flow, which is being triggered by PowerApps.
Once I realized that triggerBody was causing the initial error, I tried multiple formatDateTime options and date conversions to no avail. I stumbled upon a post that pointed me to the true solution which was reformatting the date in PowerApps before passing it to Flow.
Here is the scenario and solution.
PowerApp triggered flow to create an 'All Day' event in a SharePoint calendar.
After creating the event using the Create Item SharePoint action, you need to use a Send HTTP Request to SharePoint action to set 'fAllDayEvent' to true.
This will cause errors if you are not passing the correctly formatted date to update the EventDate and EndDates to drop the time.
I set 2 dates. One that is used to create the initial event in the calendar, this is just the standard date picker value and the second date is formatted to an ISO text format. This is passed directly into the Send HTTP Request action.
This is the formatted date to use in the Send HTTP request action.
Read the announcement for more information!
Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.
We've updated and improved the layout and uploading format of the Power Automate Cookbook!
Fill out a quick form to claim your user group badge now!
The top training and networking event across the globe for Microsoft Business Applications