Hi,
I created an app with a form to attach a file.
I have connected my app with my flow.
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.
Hi Manish,
Thank you it works now 😁
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
Hi Manish,
It does not work as it is expecting a record value:
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
2. Next set the attachment property as the input parameters passed to power automate as shown below:
Please remember to give a 👍 and accept my solution as it will help others in the future.
Hi Manish,
I do not know where to write the formula for the file type. My formula in PowerApps is as below:
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.
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
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.
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.
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:
2. Next, in the power automate, go to approval action and click on 'show advanced options' as highlighted in the below screenshot:
3. Finally, pass those file input parameters in the attachments property as shown below:
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.
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.