Hi,
I have an automated flow that sends an email upon creating a new item in the primary SharePoint list. Everything is functional with that email.
However, I want to send a copy of that email to another recipient whose name comes from a lookup in another SharePoint list. Essentially, I first tried to link the lookup to also transpose the column with the email address (from an Office 365 account), but I found that this doesn't work. So I then tried writing the email address in a text field 'TextEmail'], that I can now lookup in the primary Sharepoint list ("List2"). So far so good.
The problem then comes to adding this "Text field" email address into the "To:" field of my "Send an email" flow. In the "Add dynamic content" choices, only fields that are recognized as emails (people or group columns) are available... So I tried to add an expression but it does not seem to work (the flow is successful, however it returns nothing - blank - as a result of the expressions I have tried). I have tried:
triggerBody()?['TextEmail']
triggerBody()?['List2']?['TextEmail']
string(triggerBody()?['TextEmail']
I also replaced the email address in the "TextEmail" to add "mailto:" before the email address, same result (blank).
Is there something else you could suggest to get this to work?
Thanks for any suggestions you may have!
@Blamb , Is TextEmail a lookup column on your primary list?
Hi @annajhaveri , thanks for taking the time to read my question.
TextEmail is a lookup column; it gets the information from the secondary list.
Well, it turns out I found a way to make it work and solved my own problem. It's a bit convoluted but perhaps it can help someone else in the same predicament.
I created another Person or Group column ("Email"). I created a flow that updates the item (in this test, I used a manual trigger - for a selected item).
For a selected item
Get item
Update item
In the new Person or Group column "Email Claims", I entered the dynamic content of the TextEmail column: outputs('Get_item')?['body/TextEmail/Value'].
This populates the new Email column with the data from the Lookup column, as a functional Person or Group which can now be put into the "To:" field of a "Send an email" flow step.
User | Count |
---|---|
85 | |
38 | |
23 | |
20 | |
16 |
User | Count |
---|---|
127 | |
49 | |
46 | |
27 | |
25 |