Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Approval flow based on Forms with attachments - allow for different file types

(0) ShareShare
ReportReport
Posted on by 73

Hi,

 

I have a Forms form for sending through a request for reimbursement.  It includes a required field for a copy of the receipt, and the allowed file types are pdf and image to give staff the option of scanning their receipt or using their phone and taking a photo.

 

The flow is triggered when the form is submitted, I've used Parse JSON to get the attachment, then it goes for approval.  If the request is approved, it will create a file (the attachment) in the Approved folder in a specified document library.  If it's declined it will create a file in the Declined folder in the same document library.

 

I need to attach the document to the Start & Wait for Approval step, the Create File Step (in both approved and not) and in the send an email step that goes back to the staff member.

 

I would also love for the attachment to appear in Teams for the approval but I understand that's a WIP?

 

My issue is specifying the file types.  If I don't specify a file type in the File Name section of either of the steps listed above, the attachment wont open.  I can add .jpeg or .pdf or whatever at the end of the file name and that will allow the attachment to save and attach to emails in that format - great!  But it only works if it matches the format that was initially submitted.

 

I feel like I'm missing something small but important that will allow for the different file types.  Screenshots of my flow are below.

 

Also, can I somehow add a step to remove the initial document from my OneDrive once it's been actioned and added to where it needs to go in the document library?  Or rename it in my OneDrive so that it's identifiable and then I can just use the

KatLane_1-1645486042890.pngdynamic content in all my steps rather than specifying a file name?  Or ideally both?

 

KatLane_0-1645485997155.png

KatLane_2-1645486155509.png

KatLane_3-1645486284782.png

KatLane_4-1645486346800.png

KatLane_5-1645486461175.png

KatLane_6-1645486559555.png

 

  • rodriguezschaef Profile Picture
    on at
    Re: Approval flow based on Forms with attachments - allow for different file types
  • Verified answer
    KatLane Profile Picture
    73 on at
    Re: Approval flow based on Forms with attachments - allow for different file types

    @lisae1103 yes I did!

    I have a lot of stuff in the middle to customise the date as I'm in Australia so wanted the dd/mm/yyyy.  And then need to be able to save it with the date in the file name so there's an option with dd_mm_yyyy.  If that's not applicable to you then just skip over those variables.

    KatLane_0-1653353948267.png

     

    You need two variables - one for the approval and one for the email

    KatLane_1-1653354292333.png

    I'm going from memory here, I believe the expression for the condition is related to the compose above it, so the expression is empty(outputs('Get_response_details')?['insert dynamic content from compose output here'] and then is equal to false.

     

    So if empty = false, then you have an attachment so for the no condition, there's nothing to do, but for yes (meaning you have an attachment) then I Parse JSON for the attachment.

    KatLane_2-1653354662554.png

    Then I need the file content which is where your two variables above come in:

    KatLane_3-1653354723865.png

    You can see above that "ContentBytes" works for the email attachment, whereas "Content" works for the approval.

     

    Then in the Start and Wait for Approval, in the attachment section you'll need to toggle to input the entire array, and from there you'll use the dynamic content of the variable for the approval that you set up previously.

     

    It's definitely handy to rename your variables so that you can track which is which.

    KatLane_4-1653357017332.png 

    You then have the condition based on the approval response.

    KatLane_5-1653357673795.png 

    Part of which triggers an email with the attachment, and same as above with the start and wait for approval, you need to toggle the attachment section but this time use the Email variable.

    KatLane_6-1653358413884.png

     

    I hope that helps.  It's been a while since I got it working so you tested my memory a bit there!

  • lisae1103 Profile Picture
    6 on at
    Re: Approval flow based on Forms with attachments - allow for different file types

    Hi. Did you ever fix this flow? It is exactly what I am looking to recreate! 

  • KatLane Profile Picture
    73 on at
    Re: Approval flow based on Forms with attachments - allow for different file types

    I've updated my flow since my initial post above, based on this video and this blog.  I'm so close, but still no luck, it's now throwing an error at the start and wait for approval step.  Here are screenshots of my updated flow with the error.

    KatLane_0-1646000753771.png

    KatLane_1-1646000771620.png

    KatLane_2-1646000798482.png

    KatLane_3-1646000834052.png

    KatLane_4-1646000849062.png

    KatLane_5-1646000866934.png

    KatLane_6-1646000892584.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1