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 / Get Attachment V2 - Ba...
Power Automate
Answered

Get Attachment V2 - Bad Request

(0) ShareShare
ReportReport
Posted on by 16

Hello,

 

I'm creating a flow where I need to get content of a csv attachment from shared mailbox.

Flow triggers correctly & condition identifies correct attachment.

Then the Get Attachment V2 fails with a Bad Request error message.

 

MarekFe_1-1704978331565.png

 

I see that the input is correct.

I dont uderstand why the output gives me this message:

 

 

{"statusCode":400,"headers":{"Date":"Thu, 11 Jan 2024 12:57:29 GMT","Connection":"close","Content-Type":"text/html; charset=us-ascii","Content-Length":"324"},"body":"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\"http://www.w3.org/TR/html4/strict.dtd\">\r\n<HTML><HEAD><TITLE>Bad Request</TITLE>\r\n<META HTTP-EQUIV=\"Content-Type\" Content=\"text/html; charset=us-ascii\"></HEAD>\r\n<BODY><h2>Bad Request - Invalid URL</h2>\r\n<hr><p>HTTP Error 400. The request URL is invalid.</p>\r\n</BODY></HTML>\r\n"}

 

 

All I'm looking for is to get the "contentBytes"of the attachment for further processing.

 

Please help.

 

Thank you

Kind Regards

Marek

Categories:
  • MarekFe Profile Picture
    16 on at

    Now that I posted this message I see that instead of using Attachment ID I added the whole attachment in the ID field.

     

    How do I get just the Attachment ID from the output of the condition ?

     

    {
     "@odata.type": "#microsoft.graph.fileAttachment",
     "id": "AAMkADFiZjZhNgAQAO99MC-1PfJHn_4AnkXCJ4c=",
     "lastModifiedDateTime": "2024-01-11T12:57:11+00:00",
     "name": "Daily PDC_2024-01-10.csv",
     "contentType": "image/jpeg",
     "size": 1312,
     "isInline": false,
     "contentId": "2B29D731546@eurprd01.prod.outlook.com",
     "contentBytes": "U3RhdGlzdGljcyB"
    }

     

    Thank you

  • MarekFe Profile Picture
    16 on at

    Soo I found the solution.

    I just run the condition output through Compose.

    Then reference contentBytes from the Compose Array.

     

    MarekFe_0-1704981634328.png

     

    Still I would like to know if there is a way to use the Get Attachment V2 ?

     

    Thank you

    Kind Regards

    Marek.

     

  • Verified answer
    Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi Marek

     

    You need to pass the attachment id from the dynamic content window as shown below:

    ManishSolanki_0-1704983306802.png

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • MarekFe Profile Picture
    16 on at

    Thank you Manish, It works like that.

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 423

#2
11manish Profile Picture

11manish 308 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 177

Last 30 days Overall leaderboard