cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
user180618
Helper I
Helper I

Initializing variables from column values in Flow email

I have a Flow that sends an email when a SharePoint item is created. The Flow also has 'Get attachments/Initialize variable/Append to string variable' actions to get the item attachment's AbsoluteUri into the email body.

 

I would also like to have the created item's other column values (Name, Location, etc) displayed in the email Body and not just a link to the attachment. When I to initialize those column values as string variables it just leads me to multiple 'Apply to each/Select an output' loops and the Flow fails. Any suggestions?

1 ACCEPTED SOLUTION

Accepted Solutions

 

Hi @user180618 ,

 

You could initialize other string variables to collect the values of lookup columns by using a similar method to get attachments link.

Image reference:

13.PNG14.PNG15.PNG

Hope that makes sense.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
ScottShearer
Super User III
Super User III

@user180618 

Can you post screen shots of what you have so far?  That will be a big help for those trying to assist.

 

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

Scott
v-bacao-msft
Community Support
Community Support

 

Hi @user180618 ,

 

Please try this configuration:

10.PNG11.PNG

Hope this helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for the reply @v-bacao-msft. I can already initialize the link variable and get it into the email body, but here's a screenshot of the loop I get into when I try to get the list item's other column values into the email. 

 

Screenshot.png

Btw my previous actions are the same as yours (When an item is created > Get attachments and so on).

Hello @user180618 

Which is the data type of Column 2, Column 3 and Column 4? Multiple Choice Fields with string values? Lookup columns?

 

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

@fchopo yes, they're multiple choice fields with string values.

 

Hi @user180618 ,

 

You could initialize other string variables to collect the values of lookup columns by using a similar method to get attachments link.

Image reference:

13.PNG14.PNG15.PNG

Hope that makes sense.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thanks @v-bacao-msft, that worked. One more thing, what's the expression to have the ; separator (like in Column1 Value; in your screenshot) only appear in between multiple values rather than at the end?

So for example, let's say the multiple choice values in my Column1 are New York, San Francisco and Dallas. If Dallas and New York are selected in the List, the email currently shows: Dallas; New York; and if only New York is selected, the email shows: New York;

 

In other words, removing the last character in the string. I've tried adding this expression in the email Body next to each appended value, but that doesn't seem to do it:

substring(variables('Column1'),0,sub(length(variables('Column1')),1))

 

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (3,904)