Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Send attachment from PowerApps form to Teams via flows for approval

(0) ShareShare
ReportReport
Posted on by 24

Hi,

 

I created an app with a form to attach a file.

DamMat_0-1681870235891.png

 

I have connected my app with my flow.

DamMat_1-1681870269253.png

DamMat_2-1681870339265.pngDamMat_3-1681870366774.png

 

DamMat_4-1681870433631.png

DamMat_5-1681870469852.png

 

With my flow I want to send a request for approval via Teams and have the attachment attached. Is it possible to do this and do you know how?

 

Thank you.

Categories:
  • DamMat Profile Picture
    DamMat 24 on at
    Re: Send attachment from PowerApps form to Teams via flows for approval

    Hi Manish,

     

    Thank you it works now 😁

  • Verified answer
    ManishSolanki Profile Picture
    ManishSolanki 15,075 on at
    Re: Send attachment from PowerApps form to Teams via flows for approval

    Hi @DamMat 

     

    Yes you are right, it should be a record. My apologies, pls try this to send the file content parameter to power automate, we need to set name & contentBytes properties for file content record as mentioned below:

     

    startapprovalprocess.Run(First(DataCardValue11_1.Attachments).Name,{file: {
    contentBytes: First(DataCardValue11_1.Attachments).Value,
    name: First(DataCardValue11_1.Attachments).Name
    }})

     

    here, startapprovalprocess accepts two parameters i.e. file name & file content.

     

    Please let me know if you still face the same issue.

    Thanks

  • DamMat Profile Picture
    DamMat 24 on at
    Re: Send attachment from PowerApps form to Teams via flows for approval

    Hi Manish,

     

    It does not work as it is expecting a record value:

     

    DamMat_0-1681880078014.pngDamMat_1-1681880122541.png

     

  • ManishSolanki Profile Picture
    ManishSolanki 15,075 on at
    Re: Send attachment from PowerApps form to Teams via flows for approval

    Hi @DamMat 

     

    Please remove the parenthesis '{' before the First formula as it makes the flow calling syntactically incorrect. After you correct it, consume those parameters in power automate flow as shown below in the screenshot:

    1. Click on Show Advanced options link in approval action

    ManishSolanki_0-1681878950720.png

    2. Next set the attachment property as the input parameters passed to power automate as shown below:

    ManishSolanki_1-1681879134900.png

     

    Please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • DamMat Profile Picture
    DamMat 24 on at
    Re: Send attachment from PowerApps form to Teams via flows for approval

    Hi Manish,

     

    I do not know where to write the formula for the file type. My formula in PowerApps is as below:

    DamMat_0-1681877768170.png

    Can you be more specific about where to write this formula? First(DataCardValue11_1.Attachments).Value

    Before I was using this formula for the attachment:

    {Attachments: AddColumns(RenameColumns(DataCardValue15.Attachments,"Value","ContentBytes"),"@odata.type","")}

     

    Thank you.

  • ManishSolanki Profile Picture
    ManishSolanki 15,075 on at
    Re: Send attachment from PowerApps form to Teams via flows for approval

    Hi @DamMat 

     

    Please pass those parameters from canvas app to power automate and follow the intructions to consume those input paramenters in the power automate flow.

     

    Thanks

  • DamMat Profile Picture
    DamMat 24 on at
    Re: Send attachment from PowerApps form to Teams via flows for approval

    Hi Manish,

     

    Thank you for your reply.

    I am sorry but where should I enter the below formulas? In PowerApps or Flows?

     

    1.  Pass the attachment from canvas app as an input parameters. The parameters are attachment name & value. Name will of text type & Value will of file type. You can get those properties using the below formulas:

     

    Attachment Name: First(DataCardValue11_1.Attachments).Name

    Attachment Value: First(DataCardValue11_1.Attachments).Value

     

    Thank you.

  • Pstork1 Profile Picture
    Pstork1 65,019 on at
    Re: Send attachment from PowerApps form to Teams via flows for approval

    That will send the attachment to the approval action just fine. But the point is that it won't show up in the Teams Approval app.  It doesn't matter whether you attach it successfully or not.  There's a bug that keeps it from being displayed in Teams, which is what the original question asked.

  • ManishSolanki Profile Picture
    ManishSolanki 15,075 on at
    Re: Send attachment from PowerApps form to Teams via flows for approval

    Hi @DamMat 

     

    Please follow the below instructions:

     

    1.  Pass the attachment from canvas app as an input parameters. The parameters are attachment name & value. Name will of text type & Value will of file type. You can get those properties using the below formulas:

     

    Attachment Name: First(DataCardValue11_1.Attachments).Name

    Attachment Value: First(DataCardValue11_1.Attachments).Value

     

    Assuming, DataCardValue11_1 is the control for uploading the file.

     

    The parameters in power automate flow will look like:

    ManishSolanki_0-1681871451570.png

     

    2. Next, in the power automate, go to approval action and click on 'show advanced options' as highlighted in the below screenshot:

    ManishSolanki_1-1681871571341.png

     

    3. Finally, pass those file input parameters in the attachments property as shown below:

    ManishSolanki_3-1681871707354.png

     

    I hope you will able to send the attachment to approval action using the abovesaid steps. Please let me know if you face any problems.

     

    Please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

     

    Note: The above steps will work if you are sending a single attachment from the canvas app. For multiple attachments, you need to pass multiple input parameters to power automate and modify the flow accordingly. 

     

  • Pstork1 Profile Picture
    Pstork1 65,019 on at
    Re: Send attachment from PowerApps form to Teams via flows for approval

    Right now there is a known bug that keeps attachments to flows created in Power Automate directly from being displayed inside then Teams Approval app. Only attachments attached inside Teams will show. So you can attach the file and it will be approved, but people in Teams won't see it in Teams.  They will only see it if they access it in the Power Automate web client or through the email that is sent by the approval.  This has been a bug for well over two years and doesn't appear to be something that will be fixed anytime soon.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,691

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 65,019

Leaderboard