cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DynamicsHS
Resolver I
Resolver I

Weekly birthday reminders at the start of every week?

Hi, 

 

I posted about this last week - I thought I had solved the problem, but the flow seems to be wrong.

 

I want to create a flow that triggers every Monday and send me a list of peoples birthdays that sit within the week. This is not a flow that send an email on the persons birthday. But rather pulls a list of all the upcoming birthday this week. 

 

I have created this flow:

DynamicsHS_0-1659423487224.png

using: to pull the start of the week 

 

addDays(utcNow(),int(concat('-',dayOfWeek(utcNow()))),'d')

 

 & for the end of the week

 

addDays(utcNow(),sub(6,dayOfWeek(utcNow())),'d')

 

 I created a condition so that the converted birthdates in short pattern time are greater than and less than (essentially saying that the birthdate needs to sit within the start and end of the week.) 

 

However, for some reason the flow is pulling everyone's birthday who sits within the this month rather than this week. 

 

I know someone mentioned on a previous post that I should use ticks? however, I cant seem to find any good material that explains this in depth. 

 

I'm pulling my hair out with this one, hopefully someone can provide me some guidance? 

 

Regards,

Henry

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
MarconettiMarco
Super User
Super User

Hello @DynamicsHS ,

please try to check the day of month value:

1. Add a "Compose" action in which put the following expression:

dayofMonth(utcNow())

2. Add another "Compose" action putting the following expression:

add(outputs('Compose-DayOfMonthUtcNow'),6)

3. Within the Apply to each loop, add a "Compose" action putting the following expression:

dayofMonth(item()['birthdate'])

4. in the Condition control add this expression:

and(greater(outputs('Compose-DayOfMonthBirthdate'),outputs('Compose-DayOfMonthUtcNow')),less(outputs('Compose-DayOfMonthBirthdate'),outputs('Compose-Add6Days')))

if equal to 

true

 

Append to Array variable.

 

Here the full flow:

MarconettiMarco_0-1659427788724.png

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

BR,

Marco

View solution in original post

2 REPLIES 2
MarconettiMarco
Super User
Super User

Hello @DynamicsHS ,

please try to check the day of month value:

1. Add a "Compose" action in which put the following expression:

dayofMonth(utcNow())

2. Add another "Compose" action putting the following expression:

add(outputs('Compose-DayOfMonthUtcNow'),6)

3. Within the Apply to each loop, add a "Compose" action putting the following expression:

dayofMonth(item()['birthdate'])

4. in the Condition control add this expression:

and(greater(outputs('Compose-DayOfMonthBirthdate'),outputs('Compose-DayOfMonthUtcNow')),less(outputs('Compose-DayOfMonthBirthdate'),outputs('Compose-Add6Days')))

if equal to 

true

 

Append to Array variable.

 

Here the full flow:

MarconettiMarco_0-1659427788724.png

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

BR,

Marco

Hi Marco, 

 

Thank you. This worked - I had the start of the week and end of the week formulas in the apply to each - they needed to be outside of it like yours. 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (5,634)