0

There are some tutorials that explain how to email someone on their birthday. What I am looking for is to send a single email with the list of all the people who celebrate their birthday that day.

I would like to know how I can send in the body of the email the name of the people who celebrate their birthday on that day.

I have been working on a flow with each of the following steps:

enter image description here

Recurrence:

With this step I send my daily mail every certain hour.

Get items:

I created a sharepoint list where I have the name of the birthday boy, date of birthday (DOB), gender and department.

enter image description here

Initialize variable:

enter image description here

Apply to each

enter image description here

Append to string variable

I add to the Birthdays variable the value that would be the name of the employee whose birthday is that day that is in the sharepoint list

enter image description here

Send an email

In the step of sending an email, I add the previously initialized variable "Birthdays" to the body of the email, which should contain the list of employees whose birthday is that day

enter image description here

I have supported myself with this question made in the Microsoft Power Automate forum but it does not work as it should since I am new to power automate

Error:

At the moment of executing my manual flow I get in the condition as a result false in addition to two errors when I add the variable and send the mail

enter image description here

Can someone give me an orientation in knowing what I am doing wrong in the flow since my mail does not arrive either.

UPDATE:

The value of the Birthdays variable at runtime is as follows:

enter image description here

UPDATE 2:

enter image description here

I have added in Filter Query the following expression formatDateTime(utcNow(),'dd-MM-yyyy') eq 'listColumn' but when executing the manual flow I get that The expression "28-01-2022 eq 'listColumn'" does not It is valid.

Annex error that shows me in the execution of the manual test

enter image description here

UPDATE 3:

The column in the sharepoint list where I am storing the birthday date is called DOB:

enter image description here

General Grievance
  • 4,555
  • 31
  • 31
  • 45
John Doe
  • 1
  • 5
  • 26
  • Sorry but can you confirm the value of the `Birthdays` variable at run time and update your question with that information? – Skin Jan 27 '22 at 23:23
  • @Skin The value that contains the variable `Birthdays` is the name of the employee, which corresponds to a field of the sharepoint list, is this correct for you? – John Doe Jan 28 '22 at 01:52
  • @Skin I have updated the question with the value of the Birthdays variable, is the update correct for you? – John Doe Jan 28 '22 at 02:02
  • I guess my point is, your condition is meant to go down the True path when the length of `Birthdays` is greater than 0. Where can we see what the value of `Birthdays` is at the time the condition runs and produces False? You're initialising the variable in that screenshot shot but where do you SET it with the names of the employees? – Skin Jan 28 '22 at 02:14

2 Answers2

0

Get Items action you should use Filter Query row to search something like: formatDateTime(utcNow(),'dd-MM-yyyy') eq 'listColumn'.(You should have a column in sharepoint containing all user birthdays). [1]: https://i.stack.imgur.com/Y3s4S.png

Append to String all the emails that you get from GetItems: Email;

blini
  • 41
  • 2
  • I have added the expression you mention but I get an error when executing the flow, any suggestions? – John Doe Jan 28 '22 at 14:21
0

Try this one; it should work:

Birthdays eq '@{formatDateTime(utcNow(), 'yyyy-MM-dd')}'

image

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
blini
  • 41
  • 2
  • Trying it this way I also get an error and it is as follows: `Column 'Birthdays' does not exist. It may have been deleted by another user.` any suggestions? – John Doe Jan 28 '22 at 15:43
  • Replace 'Birthdays' with the name of the column that contains the birthdays, in your case its 'DOB' – blini Jan 31 '22 at 08:55