Hello all -
Very new PA user here and building flows from scratch from videos and this community which have been very helpful. I know that there are some similar posts about this issue and I have tried to follow them but ultimately wind up more confused without arriving to a solution.
I have tried to generate an approval flow for a selected file (trigger) whereby a user can initiate the approval flow from a SharePoint library and include up to three attachments (though attachments are not required and may include anywhere from 0-3 attachments). I have been able to generate the requisite controls to append each attachment to an array variable and then have a conditional flow to determine the number of attachments listed and then have an email and approval step to follow each control step (not yet built out for conditions of 2 or 3 variables as I hope I can simply copy the steps for 1 attachment once it is built).
The conditions to check the value of an attachment is set as
empty(triggerBody()?['file']?['contentBytes']) "is equal to" false
If true:
<<Append to array variable>>:
{
"Name": "@{triggerBody()?['file']?['name']}",
"ContentBytes": "@{triggerBody()?['file']?['contentBytes']}"
}
After running for each potential attachment, there is an additional condition set as:
length(variables('Attachments')) "is greater than: 0
If true:
Send an email -->
attachment: variables('Attachments')[0]['ContentBytes']
attachment name: variables('Attachments')[0]['Name']
I have been able to run through the flow and the attachments are correctly shown as attachments and names in the Approval request and the emails but are corrupted and do not open and I am lost on where the error happens.
Attached are a few screenshots of the overall flow and some of what I assume to be the most relevant steps in the flow. Many thanks for any help or guidance available!