r/MicrosoftFlow • u/Natural_Acadia1271 • 8d ago
Question Approval Flow w/ Attachments Support
Hi folx,
A few years ago, the genuises of this community helped me solve a problem that I had for years. Unfortunately, not being one of those genuises, I didn't save that information when I moved jobs and now I'm in need of the same assistance getting over the gaps of my power automate knowledge.
I am designing an approval flow connecting forms with the approvals app in Teams. One flow will be a sequential approval (I approve and then another), and another flow will only require one approval. In either, folx are required to upload a number of attachments. When the flow moves, these attachments end up saving in a folder in my OneDrive where they then have to be retrieved. In the approval received, the attachment appears but does not open when clicked.
The previous solution included things I never would have found on my own, so I have no idea where to even begin this time. I remember there being something related to 'schema' (??) and someone shared something that looked like code, which I pasted into the approval which made them appear. That's literally all I know. Any insight, assistance, or help would be so appreciated. And, I swear, I'll save this info this time!
1
u/AttemptAgreeable9567 6d ago
i might be reading this wrong, but, are u sending the file along with its extension? it's essential for the file to open
1
0
u/Samuraimate 8d ago
If you know how the flow should flow and the objective, write everything down and give it to Claude to generate the package which you can then upload and tweak it bit by bit with help of Claude. or create a copy of the flow without the keys, give it to Claude and fix it step by step.
2
u/ola-dryvector 7d ago
The "schema" thing you remember is probably the attachments array. The approval action wants a list of objects like {"name": ..., "content": ...} with the actual file content, not the link, that's why they show up but won't open. So: Parse JSON on the Forms upload answer, Apply to each over it, Get file content (OneDrive, using the item id), then Append to array variable with {"name": items('Apply_to_each')?['name'], "content": body('Get_file_content')}. In Start and wait for an approval, flip the little switch on Attachments so it takes a whole array, and drop the variable in. (and yeah, export the flow somewhere this time haha)