web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Trying to get file con...
Power Automate
Answered

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

(0) ShareShare
ReportReport
Posted on by 18

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

Categories:
I have the same question (0)
  • Verified answer
    v-alzhan-msft Profile Picture
    on at

    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.

  • seamustl Profile Picture
    18 on at

    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!

  • v-alzhan-msft Profile Picture
    on at

    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.

  • seamustl Profile Picture
    18 on at

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard