Adding Multiple Attachments Uploaded to a Form to an Approval
Flow I created for our In-Kind gift forms is working great. However, I now need to tweak it a bit and have not been successful in figuring out how to do it.
When we receive an In-kind donation, the donor fills out a Microsoft Form on an iPad. We use the iPad to take a picture of the donation and upload it to the form. When the form is submitted, a flow is triggered to send an Approval to our team to review. The Approval contains all of the information from the form. The picture is attached to the Approval.
Now we want to attach multiple pictures. This is where I am having problems.
I attempted to create an Array variable and went through the steps I found online. The problem is the attachments are exceeding the size limit imposed by Microsoft for attachments on Approvals.
I created a String variable following the steps from this article, Solved: how can I add MULTIPLE attachments shared links in... - Power Platform Community (microsoft.com). However, there is still a problem. The links are live in the Approval card that sent via Teams but not in the Approval email.
How can I get the links to be live in the email as well?
or is there a better way to accomplish this?
Comments
-
@Susan Fioribello - My first thought is that you may need to put the links into the approval card in HTML using the <a href> attribute. Curious what @Alex Wong suggests.
0 -
@Austen Brown
Approval action in flow doesn't use HTML, it uses Markdown, which is very different than HTML@Susan Fioribello
I'm not sure where and what the situation is, so it is best you provide some screenshot of the flow run history that failed (the action that caused an error and the error message) and screenshot of the action in edit mode that failed.I am not sure how you are doing approval action, but you do not need to do attachment
in the Details field, you can add links to the attachment (attachment is parsed with a sharepoint/onedrive location), which is what I thought you did in your previous post about handling file submitted in MS Form.
the Markdown for creating a link is:
[File Name of the Uploaded File](https://xxxxxxxx.sharepoint.com/path_to_your_file)
for example:
concat('[',first(body('Parse_JSON_Visit_Attendee_Spreadsheet'))?['name'],'](',first(body('Parse_JSON_Visit_Attendee_Spreadsheet'))?['link'],')')If you have more than one file uploaded, you can do a Apply to Each file uploaded, create a string variable to let you “append” to in the loop for each file.
2 -
@Alex Wong
Hi Alex,This is section of the flow you helped me write to attach one picture. How can I edit it to allow for multiple pictures?
In answer to your question: “in the Details field, you can add links to the attachment (attachment is parsed with a sharepoint/onedrive location), which is what I thought you did in your previous post about handling file submitted in MS Form.”
Yes, this is correct. This is a sharepoint/onedrive location but it is a shared form. Not sure if that makes a difference.
Do I still need the “Parse JSON 1 - Get First Picture"?0 -
@Susan Fioribello
the flow should be something like this (assuming the file upload is a required question)- trigger for form
- get form response
- initialize a string variable - Approval File Upload Markdown
- Parse JSON of the answer to the upload question (JSON Schema to use)
- {"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"link":{"type":"string"},"id":{"type":"string"},"type":{},"size":{"type":"integer"},"referenceId":{"type":"string"},"driveId":{"type":"string"},"status":{"type":"integer"},"uploadSessionUrl":{}}}}
- Apply to Each File Uploaded dynamic content (loop through each file uploaded)
- create a shared link
- Append to the Approval File Upload Markdown String variable:
concat('[',items('Apply_to_Each_File_Uploaded')?['name'],'](',ShareLink,'); ')
- then somewhere in your Approval action, Details box, you will put the variable Approval File Upload Markdown
0 -
0
-
@Alex Wong
I cannot get this to work. Currently, I can't get passed this:Error message at top:
“Action 'Get_file_metadata_using_path' failed: Unable to process template language expressions in action 'Get_file_metadata_using_path' inputs at line '0' and column '0': 'The template language expression 'decodeUriComponent(replace(body('Parse_JSON_Find_Picture')['link'],'https://rmhcnymetro.sharepoint.com/sites/GiftProcessingTeam', ''))' cannot be evaluated because property 'link' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'.”
Error message for Get file metadata using path:
"InvalidTemplate
Unable to process template language expressions in action 'Get_file_metadata_using_path' inputs at line '0' and column '0': 'The template language expression 'decodeUriComponent(replace(body('Parse_JSON_Find_Picture')['link'],'https://rmhcnymetro.sharepoint.com/sites/GiftProcessingTeam', ''))' cannot be evaluated because property 'link' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'."
I searched the internet like crazy and nothing I have tried is working.
BTW, the array variable is there because I was trying to make that work but it doesn't. When I add the array then the combined size of the attachments is too large.0 -
@Susan Fioribello
indead of body('Parse_JSON_Find_Picture')['link'] in the expression used in Get file metadata using path actionsince you are in an Apply to each array of uploaded file, you should be using
items('Apply_to_each')?['link']
0 -
@Alex Wong
Thanks Alex. The flow now works but there is still a problem.
The links in Teams are clickable but when I click on them a new page opens in my browser with an error message:
"This link has been removed.Sorry, access to this document has been removed. Please contact the person who shared it with you."
The links in the email aren't clickable but if I copy and paste them into a browser I can get the picture.
0 -
@Susan Fioribello
Your screenshots looks correct to me and I just tested it and it works perfectly for me:body('Parse_JSON_Uploaded_Files') decodeUriComponent(replace(items('Apply_to_Each_File_Uploaded')?['link'], 'https://xxxxx.sharepoint.com/teams/BusinessAutomation', '')) outputs('Get_File_Metadata_Uploaded_File')?['body/ItemId'] [@{items('Apply_to_Each_File_Uploaded')?['name']}](@{outputs('Create_Shared_Link_of_Uploaded_File')?['body/link/webUrl']}) Result:
Approval in Teams:
both links works and takes to browser and showed images Approval in Outlook email:
link also works 0 -
@Alex Wong
Here is what I am gettingTeams
Email (links are not clickable)
If I click on the link in Teams I get this but if I copy and paste the link I can get to the picture.
0 -
@Alex Wong
Never mind. I figured it out. I was using poor grammar.I mixed up the ( ) and the [ ] so instead of
[Name](link)
I was writing (Name)[Link]
Now that I corrected it it works!
Thank you for bearing with me. You ROCK!!!!
1 -
@Alex Wong
I have a follow-up question for this process.
Adding the multiple attachments has been working great; however, I have one flow that keeps failing. The only thing I can determine is that the attachment is a Word doc not a picture. I wrote the flow intending for Pictures.Could the problem be that it is a word document? If so, is there a way to fix it or do I need to limit the attachment type?
Here is the Error message:
Action 'Get_file_metadata_using_path' failed: File not found clientRequestId: 8e9c6083-f44c-495a-a82b-9924f9bd326b serviceRequestId: 3c0568a1-7097-7000-250d-0353031fccea
Here is where the failure is occurring:
This is the raw input for Apply to Each
Apply_to_each
{
"foreachItems": [
{
"name": "Bethpage Freeport Branch Receipts_anonymous.docx",
"id": "01N64KASGDZOSVAZUHCFBJJ4ECX5PS5S6K",
"type": null,
"size": 1256135,
"referenceId": "01N64KASGG667HKVGFAZDJJFL25A7GHP3O",
"driveId": "b!haxmJoZ3s0KHs_g2DBqWdC0JSAfJxddFh0ipKFhqTaXmXUf39q-XR4mdjLDll7xR",
"status": 1,
"uploadSessionUrl": null
}
]
}
Get_file_metadata_using_path
{
"host": {
"connectionReferenceName": "shared_sharepointonline",
"operationId": "GetFileMetadataByPath"
},
"parameters": {
"dataset": "https://xxx.sharepoint.com/sites/GiftProcessingTeam",
"path": "/_layouts/15/Doc.aspx?sourcedoc={50A5CBC3-8766-4211-94F0-82BF5F2ECBCA}&file=Receipts_anonymous.docx&action=default&mobileredirect=true"
}
}
In case it is relevant, here is the JSON
Parse_JSON_Find_Picture
{
"content": "[{\\"name\\":\\"Bethpage Freeport Branch Receipts_anonymous.docx\\",\\"link\\":\\"https://rmhcnymetro.sharepoint.com/sites/GiftProcessingTeam/_layouts/15/Doc.aspx?sourcedoc={50A5CBC3-8766-4211-94F0-82BF5F2ECBCA}&file=Bethpage Freeport Branch Receipts_anonymous.docx&action=default&mobileredirect=true\\",\\"id\\":\\"01N64KASGDZOSVAZUHCFBJJ4ECX5PS5S6K\\",\\"type\\":null,\\"size\\":1256135,\\"referenceId\\":\\"01N64KASGG667HKVGFAZDJJFL25A7GHP3O\\",\\"driveId\\":\\"b!haxmJoZ3s0KHs_g2DBqWdC0JSAfJxddFh0ipKFhqTaXmXUf39q-XR4mdjLDll7xR\\",\\"status\\":1,\\"uploadSessionUrl\\":null}]",
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"link": {
"type": "string"
},
"id": {
"type": "string"
},
"type": {},
"size": {
"type": "integer"
},
"referenceId": {
"type": "string"
},
"driveId": {
"type": "string"
},
"status": {
"type": "integer"
},
"uploadSessionUrl": {}
}
}
}
}
0 -
@Susan Fioribello
The error message is pretty clear: “File not found”.Obviously the file uploaded exists, so meaning something is wrong in the input you provide to the Get file metadata using path action.
You need to provide edit mode of Get file metadata using path action and a run history of this action. Your screenshot was not correctly giving info on this action, rather was on the condition action.
0
Categories
- All Categories
- 2 Blackbaud Community Help
- High Education Program Advisory Group (HE PAG)
- BBCRM PAG Discussions
- Luminate CRM DC Users Group
- DC Luminate CRM Users Group
- Luminate PAG
- 186 bbcon®
- 1.4K Blackbaud Altru®
- 389 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 14 donorCentrics®
- 355 Blackbaud eTapestry®
- 2.4K Blackbaud Financial Edge NXT®
- 616 Blackbaud Grantmaking™
- 542 Blackbaud Education Management Solutions for Higher Education
- 3.1K Blackbaud Education Management Solutions for K-12 Schools
- 909 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 207 JustGiving® from Blackbaud®
- 6.2K Blackbaud Raiser's Edge NXT®
- 3.5K SKY Developer
- 236 ResearchPoint™
- 116 Blackbaud Tuition Management™
- 160 Organizational Best Practices
- 232 The Tap (Just for Fun)
- 30 Blackbaud Community Challenges
- Blackbaud Consultant’s Community
- 18 PowerUp Challenges
- 3 Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 Raiser's Edge NXT PowerUp Challenge: Events
- 3 Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 Raiser's Edge NXT PowerUp Challenge #1 (Query)
- 71 Blackbaud Community All-Stars Discussions
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 743 Community News
- 2.8K Jobs Board
- Community Help Blogs
- 52 Blackbaud SKY® Reporting Announcements
- Blackbaud Consultant’s Community
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)
- Blackbaud Francophone Group
- Blackbaud Community™ Discussions
- Blackbaud Francophone Group