All,
In my Flow (triggered from a PowerApp) I'm creating a SharePoint Calendar List item. As part of the item I want the Start Time to be the passed in via the PowerApp StartDate whereby the time portion of the datetime is: "00:00:00Z". Similarly, I want the End Time to be the passed in via the PowerApp StartDate whereby the time portion of the datetime is: "23:59:59Z". This will create an "all-day" entry on the SharePoint calendar. How do I make this happen?
Note: keep in mind I don't know whether or not the PowerApp StartDate provided has any time associated with it. It might be zeros and then again it might be some randon time of a day.
Example:
I've tried to do all sorts of string manipulation as well as applying datetime funcitons like addHours, addMinutes, and addSeconds. Nothing seems to work.
HELP, thanks!
Solved! Go to Solution.
Looks like I finally cracked the code! Here's what finally got it working...
TempString = addDays(triggerBody()?['Start_x0020_date'],variables('PRCount'))
StartDate = convertToUtc(variables('TempString'),variables('PST'))
TempString2 = concat(substring(variables('TempString'),0,indexOf(variables('TempString'),'T')),'T23:59:59')
EndDate = convertToUtc(variables('TempString2'),variables('PST'))
I have experimented with custom date/time formats for different use cases, including all day events, but our applications of these features may be different.
I am not sure I follow exactly what you're trying to do - are you trying to add an all-day event to a SharePoint Calendar by manually triggering a Microsoft Flow?
Could you share screenshots of your Flow?
The date from the PowerApp is: triggerBody()?['Start_x0020_date']
StartDate =
Looks like I finally cracked the code! Here's what finally got it working...
TempString = addDays(triggerBody()?['Start_x0020_date'],variables('PRCount'))
StartDate = convertToUtc(variables('TempString'),variables('PST'))
TempString2 = concat(substring(variables('TempString'),0,indexOf(variables('TempString'),'T')),'T23:59:59')
EndDate = convertToUtc(variables('TempString2'),variables('PST'))
Nice!
Usually, I receive error messages that require all day events to have start and end times that add up to 24 hours.
Hi @pbenati,
Have you solved your issue on your side?
You could also consider take a try to achieve your needs with the following workaround:
2018-01-24T12:00:34
Note: I use the StartDate variable to instead of the PowerApps app inputed StartDate on my side.
concat(substring(variables('StartDate'),0,indexOf(variables('StartDate'),'T')),'T00:00:00Z')Add a Compose 2 action, rename it as "End Time", Inputs set to following formula:
concat(substring(variables('StartDate'),0,indexOf(variables('StartDate'),'T')),'T23:59:59Z')
Image reference:
The flow works successfully as below:
Best regards,
Kris
User | Count |
---|---|
91 | |
44 | |
21 | |
18 | |
16 |
User | Count |
---|---|
134 | |
49 | |
42 | |
36 | |
28 |