email address and variables

Copper Contributor

Hi,

 

I have a SharePoint list which holds lots of different information.

 

In that list is a field called 'Engagement Lead' where the name can be different for each item on the list.

 

I'm trying to setup a notification so that

 

Scheduled email runs at 20:00 ever night

Looks for anything in the SharePoint list that has been updated that day

Send and email to those people (in the Engagement Lead field) advising that something has been updated, take a look.

 

The problem i'm having is, say for example there are 3 entries that have been updated today.  My Power Automate workflow will work as such

 

Identify all records that have changed

Send email to Engagement Lead 1

Send email to Engagement Lead 1 AND Engagement Lead 2

Send email to Engagement Lead 1 AND Engagement Lead 2 AND Engagement Lead 3

 

which obviously shouldn't be the case, it should be

Send email to Engagement Lead 1

Send email to Engagement Lead 2

Send email o Engagement Lead 3

 

 

I'm aware that the problem is most likely with my Apply to Each loop but i can't seem to work it out.

 

Hoping this makes sense?!?

1 Reply

@ross_cartledge ,

you get through all items which have been changed and for each of those, you append the e-mail, means which each loop another or the same e-mail will be added.
One option would be to get the items and then filter the e-mail addresses (first select statement, my people picker column is named 'Person').
Afterwards remove any duplicate (union expression within the compose action) and perform whatever you like with the distinct values you get in return.
See below screenshot for your reference.
I have added an additional Apply to each action to filter for the related items of each person (@equals(item()?['Person/Email'], items('Apply_to_each')?['mailAddys']))
, as the point in time might come, your audience is asking for more details about the items they are supposed to have a look at 😉)

Micca0815_0-1698911595631.png