cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Brian-C
Frequent Visitor

Attachments in Approvals - Variable Quantity

Hello,

 

I read up recently that it was now possible to include attachments directly within the Approval email using the V2 Approval action. I want to test this out, but for my particular scenario, the email that triggers the Flow may have one or more attachments - the number of attachments isn't fixed.

 

I tried this out using the 'array' option but got a non-serialized error. Is there something specific I should be doing here, or is it not possible to include attachments if the quantity varies?

 

In flow:

attachments2.PNG 

On run:

attachments3.PNG

1 ACCEPTED SOLUTION

Accepted Solutions

@Brian-C 

See my example below.  After the Get Attachment action, your steps for building the array should be the same.  Please note that emails frequently include images for logos, etc. and they are considered attachments.

EmailAttach.jpg

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

6 REPLIES 6
ScottShearer
Super User III
Super User III

@Brian-C 

The following worked for me (just ran a test).  Note that I use Content rather than ContentBytes.

Attach1.jpg

Attach2.jpg

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
v-alzhan-msft
Community Support
Community Support

Hi @Brian-C ,

 

Could you share the value that you entered in the Attachment field?

The Array for the Attachments in the approval should as below:

[
  {
    "name": @{variables('name1')},
    "content": "@{outputs('content1')}"
  },
  {
    "name": @{variables('name1')},
    "content": "@{outputs('content2')}"
  }
]

 

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.

Hello, 

 

I see your steps are receiving attachments from SharePoint. In my case, the attachments are coming from an email. Can i still do the same with the 'Get Attachment' action for email?

 

Thanks

@Brian-C 

See my example below.  After the Get Attachment action, your steps for building the array should be the same.  Please note that emails frequently include images for logos, etc. and they are considered attachments.

EmailAttach.jpg

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

@ScottShearer 

 

Thanks for the help! Seems I got it working. The emails I use to trigger this particular flow arrive as plain text so I shouldn't have to worry about about extraneous content arriving as attachments. I wanted to get attachments directly in the approval email since I plan on using this within Teams.

 

teamsap.png

 
 

 

Appreciate the quick responses.

@Brian-C 

Glad you got it working!

Please mark your post as solved - that will help others with a similar issue find a solution.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (72,532)