Skip to main content

Notifications

Power Automate - Building Flows
Unanswered

HTTP reguest POST. Attachment not working

(1) ShareShare
ReportReport
Posted on by

I have built a Power Automate flow that retrieves attachments from a SharePoint List and creates an email draft in Outlook via an HTTP request. However, I'm encountering an issue with the Append to array variable function.


Flow Structure:

  1. Initialize Variable:

    • I have an AttachmentsArray variable initialized as an array.
  2. Append to Array Variable:

    • I believe the JSON code for the Append to array variable function should look like this:
       
      json
      {
      "type": "AppendToArrayVariable",
      "description": "",
      "inputs": {
      "name": "AttachmentsArray",
      "value": {
      "@odata.type": "#Microsoft.OutlookServices.FileAttachment",
      "Name": "@items('For_each_2')?['DisplayName']",
      "ContentBytes": "@{outputs('Get_attachment_content')?['body']}"
      }
      },
      "runAfter": {
      "Get_attachment_content": [
      "Succeeded"
      ]
      },
      "metadata": {
      "operationMetadataId": "e3c2e5e3-663e-4598-8c4e-6fd21cc872aa"
      }
      }

The Issue:

  • Power Automate does not allow the @ symbol in the @odata.type property.
  • As a result, I cannot save my flow when attempting to use the Append to array variable function with this JSON structure.

Working Alternative:

If I use the Send an email (V2) function instead of an HTTP request, everything works without requiring the @odata.type property. However, I want to proceed with the HTTP request approach, which requires the @odata.type property for properly attaching files.


Key Question:

  • Is there a way to configure the @odata.type property or an alternative approach to include attachments in the HTTP request without encountering this issue?
 

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard