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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to pass an attachm...
Power Automate
Unanswered

How to pass an attachment from a powerapp using the .run call using parameters

(2) ShareShare
ReportReport
Posted on by 716 Moderator
I inherited a simple little feedback app that was built in the strangest way. Rather than create the SP list item directly from a Submit on the form, the Submit button passes parameter to a flow that then generates an email and creates the SP list item.
 
I understand why the email creation is in the flow but the SP list item could have been directly created but I don't want to rebuild this entire thing, I just want to pass the attachment details in the call and be done with it.
 
This is the call I inherited. There is no attachment parameter included even though there is an attachment control on the form which obviously confuses the hell out of everyone and why the ticket landed in my lap.
 
If(
    IsMatch(
        BusinessKCDataCardValue.Text,
        "(?:http(s):\/\/)[\w.-]+(?:\.[\w.-]+)+[\w\-\.,@?^=%&:/~\+#\{\}]*"
    ) Or IsBlank(BusinessKCDataCardValue.Text),
    PeerFeedbackFlow.Run(
        EmployeeDataCardValue.Selected.Email,
        FeedbackDataCardValue.Selected.Value,
        DataCardValue1.Text,
        If(
            IsBlank(BusinessKCDataCardValue.Text),
            "N/A",
            (BusinessKCDataCardValue.Text)
        )
    );
    Navigate(Screen2),
    Notify(
        "Invalid URL!",
        NotificationType.Error
    )
)
 
I tried the following but it errors because I'm not passing the filename and content correctly it appears.
 
If(
    IsMatch(
        BusinessKCDataCardValue.Text,
        "(?:http(s):\/\/)[\w.-]+(?:\.[\w.-]+)+[\w\-\.,@?^=%&:/~\+#\{\}]*"
    ) Or IsBlank(BusinessKCDataCardValue.Text),
    PeerFeedbackFlow.Run(
        EmployeeDataCardValue.Selected.Email,
        FeedbackDataCardValue.Selected.Value,
        DataCardValue1.Text,
        If(
            IsBlank(BusinessKCDataCardValue.Text),
            "N/A",
            (BusinessKCDataCardValue.Text)
        ),
        First(AttachmentsDataCardValue17.Attachments)
    );
    Navigate(Screen2),
    Notify(
        "Invalid URL!",
        NotificationType.Error
    )
)
 
I don't understand what the correct syntax is for that .Run call. It seems like the parameters showed be named somehow but maybe they just need to be sent in the correct order
and that's why it works now. PLEASE, ignore any screwed up formatting in this post. This new site sucks so bad I put off even making this post for days because of the new UI.
 
How do I correctly send the filename and contents so that they land in the Trigger step and I can then reference the file name and file contents in the Add Attachment step after
the Create Item step?
 
 
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at
    Hi,
     
    What trigger are you using??? Make sure you are using Power Automate V2 NOT V1 and do the following
     
    Here is how.
     
    My App Screen
     
    My Send to Flow Expression (where DataCardValue16 is my attachment control)
     
    '[Sample]SendAttachmenttoFlow'.Run(
         
       Last(DataCardValue16.Attachments).Name,
       {
           file: {
                    contentBytes: Last(DataCardValue16.Attachments).Value,
                    name: Last(DataCardValue16.Attachments).Name
                }
       }
    )
    
     
    My Power Automate Trigger
     
     
    Please select as the answer if this helped you
     
     
     
     
     
  • DCHammer Profile Picture
    716 Moderator on at
    Thank you FLMike. Worked a treat and I learned something new. Very much appreciated.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard