cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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
Highlighted
Community Support
Community Support

Re: Initializing variables from column values in Flow email

 

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
Highlighted
Super User III
Super User III

Re: Initializing variables from column values in Flow email

@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
Highlighted
Community Support
Community Support

Re: Initializing variables from column values in Flow email

 

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.
Highlighted
Frequent Visitor

Re: Initializing variables from column values in Flow email

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

Highlighted
Super User II
Super User II

Re: Initializing variables from column values in Flow email

Hello @user180618 

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

 

Highlighted
Frequent Visitor

Re: Initializing variables from column values in Flow email

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

Highlighted
Community Support
Community Support

Re: Initializing variables from column values in Flow email

 

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

Highlighted
Frequent Visitor

Re: Initializing variables from column values in Flow email

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;

 

Highlighted
Frequent Visitor

Re: Initializing variables from column values in Flow email

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
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (6,721)