cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Martin_MC
Helper II
Helper II

Can't Open Attachment Content via Email (+Phrasing Differences)

Hi there, apologies in advance for the fairly long post but is anyone able to explain what the possible issue is here, or why two near-identical flows behave differently?

We have two different flows connected to two different SharePoint Online lists, and they are used for storing data and getting approvals. They each trigger on SharePoint's 'When an Item is Created or Modified', and - when triggered - the flow will run down a certain path based on the Status / Stage of Approval. At the end of the run, once approved, the status is updated on the SharePoint list, triggering the flow again and running down a different path to be approved by the next person. This is the gist of what these flows do.

 

The issue is in relation to attached files within these items. In my first flow I used the following steps to create a variable item storing all of the attachment content:

 

  1. Initialize Variable (Type: Array) (Name: "Attachments")
  2. Apply to Each (Get Attachment Content)
  3. Append to Array Variable ("Attachments") (DisplayName + $content)

 

I then include the "Attachments" variable in a 'Start and Wait for Approval' action further down, and this works just fine; the people recieving the approval email also receive a copy of the attached document(s) for review.

 

HOWEVER

 

I replicated this entire methodology for another process; using a SharePoint list set up in the same way, using the exact same steps as I used in the first flow, but now there is an issue with the attachments. Users are recieving an error when they try to open them post-flow. While comparing the two flows for possible differences I noticed that the phrasing of many expressions is slightly different in each flow, and I have no idea why when they were both created the same way? Some examples being:

 

FLOW 1 - ID (DIFFERENT)
@{triggerBody()?['ID']}

 

FLOW 2 - ID (DIFFERENT)
@{triggerOutputs()?['body/ID']}

 

---

 

FLOW 1 - APPLY TO EACH BODY (DIFFERENT)
@{body('Get_attachments_8')}

 

FLOW 2 - APPLY TO EACH BODY (DIFFERENT)
@{body('Get_attachments_8')?['body']}

 

---

 

FLOW 1 - APPEND TO ARRAY (THE SAME)
{
"Name": @{items('Apply_to_each_-_Get_Attachments')?['DisplayName']},
"Content": @{body('Get_attachment_content_8')['$content']}
}

 

FLOW 2 - APPEND TO ARRAY (THE SAME)
{
"Name": @{items('Apply_to_each_-_Get_Attachments')?['DisplayName']},
"Content": @{body('Get_attachment_content_8')['$content']}
}

 

Why is the default phrasing of some items different, and is that what is causing the issue in processing the attachments / content? Please note that the files open OK if accessed directly from the SharePoint list. But when processed through to someone's email they do not.

Thank you anyone who is able to shed some light on this at all.Flow1.pngFlow2.png

0 REPLIES 0

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,007)