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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Attach file to the ema...
Power Automate
Answered

Attach file to the email from URL stored in sharepoint list

(0) ShareShare
ReportReport
Posted on by 43

Hi,

I'm working on the flow that send automatic email with ticket details when "Status" of the Item is changed to "Ticket to be created". 

The flow works when it sends email with no attachment. However, it doesn't work for cases with attachment.

 

I have a sharepoint list like this:

Bartek97_0-1700743808659.png

When user changes status to 'Ticket to be created" it triggers the flow and sends email to our 3rd party partner to raise a ticket (works fine without attachment).

 

But now I'm looking for ideas how to send email with attachment. As you can see in the screenshot above in the sharepoint list I have URL that redirects to the file stored on sharepoint. I get error "not found" in "Get file content using path". 

 

I have no idea how to connect item from the list that has URL in column "Uri" with the actual file on sharepoint and then attach that file to email. I would really appreciate any ideas.

 

The flow currently looks like this:

Bartek97_1-1700744015236.png

 

Bartek97_2-1700744060873.png

 

Thank you in advance,

Categories:
  • Anchov Profile Picture
    1,986 on at

    For further assistance, could you please expand the details of the failed action "Get file content using path"? This will allow me to see how you configured the inputs and provide more targeted support.

  • Bartek97 Profile Picture
    43 on at

    hi @Anchov ,

    I changed flow a bit and now I have a different error, this time in Get attachment action:

    Bartek97_0-1701099270260.png

    The action is configured like this:

    Id- ID from trigger When an item is modified

    File identifier- id from Get attachments

    Bartek97_2-1701099421977.png

     

    The full flow looks like this and part with attachment is still not working 

    Bartek97_1-1701099318547.png

     

    First Condition is checking if ticket state is updated to "Ticket to be created" and second one is checking if attachment is available. It's working fine when there's no attachment.

     

    Best regards,

  • Anchov Profile Picture
    1,986 on at

    This looks like another circumstance where the new Power Automate designer has got a bug with it.  I tried to set up a workflow similar to yours and got same error you did with the new designer.  It looks like it was selecting the file Identifier twice:

    Anchov_4-1701125054355.png

     

    I switched to the Classic Designer. 

    Anchov_1-1701124848511.png

     

    Removed the ID and Id from the Get attachments, and then re-added them:

    Anchov_0-1701124637295.png

    Here are the expressions I used:

     

    ID: items('For_each')?['ID']
    Identifier: items('For_each_1')?['Id']

     

    Saved, and retested, now the ID and Identifier are coming through correctly:

    Anchov_3-1701125025182.png

     

  • Bartek97 Profile Picture
    43 on at

    hi @Anchov ,

    thank you very much for help, your solution works. As you said I had to switch back to the old designer. The flow works fine now

     

    However, the attachment that is being sent in the email cannot be open because the file is corrupted.

    Is there any workaround for this?

    Bartek97_3-1701160457859.png

     

    Best regards,

  • Anchov Profile Picture
    1,986 on at

    Likely, it's because the new designer has enclosed the File Content of the attachment in a base64 function.  Again, you can use the Classic designer to remove it.  See this post for more details:
    Solved: Re: can't send a file as attachment or link - Power Platform Community (microsoft.com)

  • Bartek97 Profile Picture
    43 on at

    hi @Anchov ,

    looks like I don't have issue with base64 function. I just have there DisplayName and My variable 

    Bartek97_0-1701180877268.png

     

    Do you know what else might be causing this problem?

    Best regards,

  • Bartek97 Profile Picture
    43 on at

    this is what I see in the input 

    Bartek97_0-1701181286633.png

    and I have this setup in Append to array variable action:

    Bartek97_0-1701183745780.png

     

  • Verified answer
    Anchov Profile Picture
    1,986 on at

    If I were to guess, your variable appears to be in the format of an array of objects, as seen in your screenshots. The File content field expects a singular file content. You can resolve this by either appending the [0] selector at the end of your variable in the dynamic expression editor or using the file content field directly. However, keep in mind that you might encounter the base64 bug when saving, so you'll need to follow the steps to edit the field to address this issue:

    Anchov_0-1701183844172.png

    See my other post for details.

    Solved: Re: can't send a file as attachment or link - Power Platform Community (microsoft.com)
     

  • Bartek97 Profile Picture
    43 on at

    @Anchov ,

    thank for your amazing help!

     

    This is working now, FYI- I went for solution with directly Get Attachment Content

     

    Best regards,

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard