Home > Enterprise >  How to send email with the list of all people - Power Automate
How to send email with the list of all people - Power Automate

Time:01-29

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 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

CodePudding user response:

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;

CodePudding user response:

try this one it should work: Birthdays eq '@{formatDateTime(utcNow(), 'yyyy-MM-dd')}' image

  •  Tags:  
  • Related