Hi @ThiagoMagalhães,
Below would be an example
1. Add a recurrence
a. Set the frequency to daily
2. Add a list tasks action
a. Use your group and plan
3. Add a Filter Array action
a. Switch to advanced mode
b. use the expression below
@and(and(and(not(empty(item()?['dueDateTime'])),equals(formatdatetime(item()?['dueDateTime'], 'yyyy-MM-dd'), addDays(utcNow(), 10, 'yyyy-MM-dd'))),contains(item()?['appliedCategories'], 'category4')),not(empty(item()?['_assignments'])))
This expression checks the following things:
- duedate not empty
- compares formatted due date with todays date + 10 days
- checks if the label category4 is assigned
- checks if at least one person is assigned (otherwise we cannot e-mail anybody)
4. Add an apply to each loop
a. Use the Body of the Filter Array or add it as an expression:
body('Filter_array')
5. Add a second apply to each loop
a. Use the _assignments array or add it as an expression:
items('Apply_to_each')?['_assignments']
6. Add a Get user profile
a. Use the UserId field to retrieve the profile (including the Mail address) of the user assigned, add it as an expression
item()['UserId']
7. Add a Send an Email (v2)
a. This will sent an individual e-mail to each user which is assigned to task which is exactly due in 10 days
b. Use expression to refer to details from the task, like for example the task title:
items('Apply_to_each')?['Title']
