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 / Trigger PA flow on att...
Power Apps
Unanswered

Trigger PA flow on attachment control with PA pane enabled

(0) ShareShare
ReportReport
Posted on by 19

I am building my first App and I want to trigger a flow in Power Automate that takes the files from an attachment control as input parameter. The flow will upload the files to Sharepoint.

 

In the OnSelect action the intellisens find my flow and also the attachment control, but from there i am a litle bit stuck.

 

My flow is called: LastOppFraSticos

The attachment control is called:  VedleggControl

 

How can I write the OnSelect function if I want my App to send the content of the files to my flow.

 

Categories:
  • hthpowerapper Profile Picture
    364 Super User 2024 Season 1 on at

    Dealing with adding attachments in PA may not be as straight forward as expected. From a high level you need to design the flow to expect dynamic inputs which you will pass when you run your function to run the power Automate flow... You may then need to change the files to base 64 then binary somewhere along your flow.. Also if the files are images a good place to start may be Here. Your Flow will be expecting inputs in a certain order. One way to check what the input is expecting is to go to the test portion click manual then click test. it will then display the inputs that the flow requires. also when running your flow if you click on it it should display how many arguements the flow is expecting and in what order (which is important).. As you build your flow you will have items that need to be passed from power apps and you will need to know what items your flow expects and in what order..

     

    Here is some sample code i use to handle complex images as attachments..

     

     

     

    Set(jsonOutput, JSON(colJHAPhotos, JSONFormat.IncludeBinaryData));
    TTEditAttachments2.Run(jsonOutput, MyRecord.ID, MyRecord.ID)

    Here i convert my collection of photos (colJHAPhotos) to json so I can pass it as the variable I initialize... I then parse json so i can manipulate the data... 

    sampleflow.png

  • JHD Profile Picture
    19 on at

    Many thanks for the quick answer

     

    The attachment control will only have Excel sheets.

    The flow (at this stage) have only one input parameter which is the file content

  • hthpowerapper Profile Picture
    364 Super User 2024 Season 1 on at

    You should be able to run your flow like...

    MyFlowName.Run(MyDynamicContent)

      changing 'MyFlowName' with your flow name and 'MyDynamicContent' with your dynamic content will execute your flow and pass your dynamic content then based on the information provided... although I'm guessing something will need to be changed in your flow to achieve the logic you're trying to achieve... If you'd like help I can probably step you through the flow creation but this isnt possible without seeing your flow..

  • JHD Profile Picture
    19 on at

    I tried what you are sugesting, but as you can see. There is a red line under the run command, indicating that there is a syntax problem. It is only asking for one parameter, even if the flow has two parameters, name and content.

     

    JHD_0-1689795152197.png

     

    This is a picture of the flow

    JHD_1-1689795474998.png

     

     

  • hthpowerapper Profile Picture
    364 Super User 2024 Season 1 on at

    Did you go to the power automate icon and click refresh? if that doesn't work click on the test icon in the top right of power automate editor and see what inputs it is asking for.... although you may not be able to access the test icon if it wont allow you to save your flow

    refrsh.png

  • JHD Profile Picture
    19 on at

    Just refreshing did not work.

     

    When I click the test button in PA it only ask for one parameter. That is the content of the file. The other parameter is the file name, but it is not asking for that.

     

    JHD_0-1689849983427.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

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 360 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 325

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard