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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

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

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Users online (2,416)