web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Create canvas app with...
Power Apps
Answered

Create canvas app with 2 different attachment controls and a textbox (for email)

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

I created a canvas app with 2 different attachment controls and one text box. The intention is when user clicks on submit, it passes attachment from both controls and text to Power automate flow. I am unable to come up with an expression for Submit OnSelect.

PowerApps.png

Input for Power Automate are email, file, and file_1

 

I tried many different approaches but unable to get it to work. Any help on this would be a great help.

Categories:
  • ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    Hi @Anonymous , Below code can help you:

     

     

    FLOWNAME.Run(TextInput1.Text, {{file : 
     {
     contentBytes: First(DataCardValue1.Attachment).Value,
     name: First(DataCardValue1.Attachment).Name
     }
    },
    {file_1 : 
     {
     contentBytes: First(DataCardValue2.Attachment).Value,
     name: First(DataCardValue2.Attachment).Name
     }
    })

     

     

    OR

     

    FLOWNAME.Run(TextInput1.Text, 
     {
     contentBytes: First(DataCardValue1.Attachment).Value,
     name: First(DataCardValue1.Attachment).Name
     },
     {
     contentBytes: First(DataCardValue2.Attachment).Value,
     name: First(DataCardValue2.Attachment).Name
     }
    )

     

    -----------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution ✅ if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍

    Thanks,
    ANB


  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @ANB Thank you very much for your quick response.

    I am getting below errors when I use the expression you provided.

    Errors from 1st Expression:

    Error1_1.pngError1_2.png

    Error from 2nd Expression:

    Error2.png

    Can you please assist?

  • ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    Hi @Anonymous , Apologies for incorrect syntax:  It should be Attachments not Attachment .Please use 2nd code as shown below:

     

    FLOWNAME.Run(TextInput1.Text, 
     {
     contentBytes: First(DataCardValue1.Attachments).Value,
     name: First(DataCardValue1.Attachments).Name
     },
     {
     contentBytes: First(DataCardValue2.Attachments).Value,
     name: First(DataCardValue2.Attachments).Name
     }
    )

     

     

     

    -----------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution ✅ if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍

    Thanks,
    ANB


  • Verified answer
    ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    Hi @Anonymous , To add one more thing considering that you are using add attachment action in your Flow, Select the File input parameter in PowerAppsV2 trigger. Make File a required input as shown below:

    ANB_1-1698775344448.png

    For you add attachment action do below:

    Then in the File Name use triggerBody()['file']['name'] and triggerBody()['file_1']['name']
    Then in File Content use respectively. 

    ANB_0-1698775308383.png

    -----------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution ✅ if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍

    Thanks,
    ANB


  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @ANB Sadly it throws error as "Invalid number of arguments: received 3, expected 1-2."

    Error2.png

  • ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    Can you share the screenshot of PowerAppsV2 trigger please?

     

    Thanks,

    ANB

  • Verified answer
    ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    As said in my previous response, make sure both files parameter are marked as require.

    ANB_1-1698776217747.png

    Save the flow and refresh the flow in  app and check the behaviour.

    PFB screenshot, it work fine for me:

    ANB_0-1698776193160.png

    -----------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution ✅ if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍

    Thanks,
    ANB


  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @ANB You are genius. Thank you very much. I had to make Power Automate inputs required, and that solved it.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard