cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Trying to get file content dynamically from Sharepoint, into Flow, and embedded into an email

Hello,

I've been trying to develop an automated email that will pull the following all from Sharepoint...

 

  • A list of contacts to send it to
  • The subject 
  • A segment of the text body that is dynamic between each email
  • A graphic that is different in each email and tied to the text (pulled from a Sharepoint file system as opposed to the list the others are pulled from

...and compile them into an email that is sent out per line of the Sharepoint list containing this data.

 

It can work to embed an image in the email at the moment but only for a single specified image (not a variable that can be changed per email).

 
 

image.png

Using this, I can add the selected image into the email, embedded (not as an attachment).

 

The issue I run into is when I try to utilize dynamic content here: (highlited)

image.png

 

There is a column in the lists that the rest of my information comes from that contains only the file name of the graphic meant to accompany that email. The goal is to have that text be present here where the "stairs.jpg" appears so that any file name can be used.

This is shown generally in the image below:

image.png

 

Whenever I do this, the initialize variable function stops working and I receive this message below:

image.png

 

Any assistance with this or workaround would be greatly appreciated as this is the only thing holding me up at the moment!

 

-James

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Trying to get file content dynamically from Sharepoint, into Flow, and embedded into an email

Hi @seamustl ,

 

You should set the variable directly under the get file content action inside the Apply to each:

1.png

 

Best regards,

Alice   

Community Support Team _ Alice Zhang
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

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Trying to get file content dynamically from Sharepoint, into Flow, and embedded into an email

Hi @seamustl ,

 

You should set the variable directly under the get file content action inside the Apply to each:

1.png

 

Best regards,

Alice   

Community Support Team _ Alice Zhang
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
New Member

Re: Trying to get file content dynamically from Sharepoint, into Flow, and embedded into an email

I appreciate you helping out with this; however, I'm still having issues getting this working.

 

When I try to set up my path similar to the one you show in your response (with the initialize variable outside, and the get file content with path inside), I get the below error as the initializing variable doesn't have anywhere to reference:

 
 

image.png

When I try to set it up with the "Get file content" action outside as well (as a standard path (with the inside "get file content" action having a dynamic path) I just get the same result with each email (only pulling the file that is selected in the outer "get file content action". I've included a screenshot of that setup below:

image.png

Finally when I try to keep the outside "get file content" action and use a dynamic path on both I get this error, as shown below:

 

image.png

 

 

I wonder if it is an issue with the my "Set Variable" Action. I'm just utilizing the same entry into the "Value" field in both variable actions and I've included it below for reference:

<img src="data&colon;image/jpeg;base64,@{body('Get_file_content_using_path')['$content']}" alt="My Image" />

 

I appreciate your help with this and any more information you could provide!

Highlighted
Community Support
Community Support

Re: Trying to get file content dynamically from Sharepoint, into Flow, and embedded into an email

Hi @seamustl ,

 

You have used the wrong expression:

1.png

 

Best regards,

Alice   

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

Highlighted
New Member

Re: Trying to get file content dynamically from Sharepoint, into Flow, and embedded into an email

Perfect that was the last thing I needed to get it working. Thanks for your help!

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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
Users online (9,626)