I have a simple flow which triggers when an item is created and modified in a SharePoint list. The flow posts a notification in teams personal chat when an item is created or modified. If flow triggers between 6PM today and 8AM tomorrow, I would like to delay the flow and trigger any time after 8AM. Can someone help me how to calculate the difference hours and delay the flow accordingly?
Thanks a lot in advance.
Solved! Go to Solution.
Hi @RameshMukka,
My mistake. It's an old screenshot, thank you for note.
Yes, you should check your local time falls between 00:00 and 07:59.
Correct screenshot as below:
convertTimeZone(triggerOutputs()?['body/Modified'], 'UTC', 'Pacific Standard Time','yyyy-MM-ddTHH:mm:ssZ')
formatDateTime(variables('LocalTime'),'HH:mm:ss')
Compose:
addDays(variables('LocalTime'),1,'yyyy-MM-ddT08:00:00Z')
Compose2:
convertToUtc(formatDateTime(outputs('Compose'),'yyyy-MM-ddTHH:mm:ss'),'Pacific Standard Time')
Delay Until 2:
convertToUtc(formatDateTime(variables('LocalTime'),'yyyy-MM-ddT08:mm:ss'),'Pacific Standard Time')
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @RameshMukka,
You could following steps to approach that:
1. Since the item modified time is UTC time, so you should use the convertTimeZone() function convert the utc time to your local time.
convertTimeZone(triggerOutputs()?['body/Modified'], 'UTC', 'Pacific Standard Time','yyyy-MM-ddTHH:mm:ss')
2. Use Condition action check if the time greater than 18:00 and less than 24:00:00, if yes, add 1 day, then convert it to the UTC time, the time set to 8 o'clock, and append it to the Delay Until action;
addDays(variables('LocalTime'),1,'yyyy-MM-ddT08:00:00Z')
convertToUtc(formatDateTime(outputs('Compose'),'yyyy-MM-ddTHH:mm:ss'),'Pacific Standard Time','yyyy-MM-ddTHH:MM:ssZ')
3. if no, convert the time to 8 o'clock, and append the time to Delay Until:
convertToUtc(formatDateTime(variables('LocalTime'),'yyyy-MM-ddT08:mm:ss'),'Pacific Standard Time','yyyy-MM-ddTHH:MM:ssZ')
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-litu-msft Thanks a lot for this details. Time zone conversions are a bit confusion for me. I have a question here. Why didn't you choose 'LocalTime' in your condition? Shouldn't I check my local time falls between 00:00 and 07:59? I am confused as you used 'Modified'. Can you clarify?
Hi @RameshMukka,
My mistake. It's an old screenshot, thank you for note.
Yes, you should check your local time falls between 00:00 and 07:59.
Correct screenshot as below:
convertTimeZone(triggerOutputs()?['body/Modified'], 'UTC', 'Pacific Standard Time','yyyy-MM-ddTHH:mm:ssZ')
formatDateTime(variables('LocalTime'),'HH:mm:ss')
Compose:
addDays(variables('LocalTime'),1,'yyyy-MM-ddT08:00:00Z')
Compose2:
convertToUtc(formatDateTime(outputs('Compose'),'yyyy-MM-ddTHH:mm:ss'),'Pacific Standard Time')
Delay Until 2:
convertToUtc(formatDateTime(variables('LocalTime'),'yyyy-MM-ddT08:mm:ss'),'Pacific Standard Time')
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.
User | Count |
---|---|
89 | |
59 | |
42 | |
35 | |
32 |
User | Count |
---|---|
79 | |
67 | |
57 | |
49 | |
42 |