Hi all,
I would like to do a small customizing of a Flow that I have.
Email with high priority > Create a to-do item in Microsoft To-Do
It will create a To-Do item with a reminder 2 days later.
Expression that I simply copied from a forum:
Hi @v-yamao-msft!
If I need to calculate a 'Due Date' that is 30 BUSINESS DAYS from today, could I utilize any of this logic?
So far, I know that the following formula gives me 30 days from today, but that includes weekends:
Any ideas on how to calculate 30 business days from today would be greatly appreciated!!!
Once again thanks for the help.
So the emails are getting through to my todo but the reminder date is not being set.
So I am wondering what I am doing wrong.
I have created switch cases. See images for understanding, sorry its in Swedish though.
1. I have the email, sends when high Priority, nothing else set. This part works.
2. Then see the image below, the Input (Indata) is like you wrote this, exactly this
3. Below it is just the Ouput for the Switch cases.
4. I have a feeling that either entry in point 2 is incorrect but more likely is the input in the To-Do below
For example below we have for Sunday which you said is day 0.
The reminder date is formatted exactly like this
Because I want it to set it to Tuesday.
Have I set it incorrectly? How will the system understand that its this coming Tuesday?
I have used the same logic
5. Here is how I set all of them
Case 0
Expression
adddays(triggerBody()?['DateTimeReceived'],2,'yyyy-MM-dd')
---
Case 1
Expression
adddays(triggerBody()?['DateTimeReceived'],3,'yyyy-MM-dd')
---
Case 2
Expression
adddays(triggerBody()?['DateTimeReceived'],4,'yyyy-MM-dd')
---
Case 3
Expression
adddays(triggerBody()?['DateTimeReceived'],5,'yyyy-MM-dd')
---
Case 4
Expression
adddays(triggerBody()?['DateTimeReceived'],2,'yyyy-MM-dd')
---
Case 5
Expression
adddays(triggerBody()?['DateTimeReceived'],2,'yyyy-MM-dd')
---
Case 6
Expression
adddays(triggerBody()?['DateTimeReceived'],2,'yyyy-MM-dd')
Very grateful for help, I am missing something, but what?!
Ok all setup now, ignored the time thing for now as that would be complex. Will test and get back.
Hi @abbe83,
About #1, please consider using workflow definition language function dayofweek to return the day of week component of a string timestamp. Sunday is 0, Monday is 1, and so on.
I assume that your flow should be triggered by “Office 365 Outlook – when new email arrives”, you could use the dynamic content “Received time” from the trigger.
Add a Compose action to return the day of week component of the received time.
The function could be configured likes:
dayofweek(triggerBody()?['DateTimeReceived'])
After the Compose action, you could try to use Switch cases. As we know that Thursday is 4, Friday is 5, and so on. So you can add cases likes below to create a to-do task according to the return value.
In the action “Add a to-do”, add days according to the return value so that you can create a reminder date as Tuesday the following week.
Say if the received date is Thursday, the function for the reminder date is:
adddays(triggerBody()?['DateTimeReceived'],5,'yyyy-MM-dd')
The flow could be configured to something likes below:
Reference materials:
Workflow definition language
Switch case
About #2 and #3, you may consider using the action “Convert time zone” in your flow.
Please check this blog for more details:
https://flow.microsoft.com/en-us/blog/working-with-dates-and-times/
Best regards,
Mabel Mao
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492