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 / Attaching file(s) to A...
Power Apps
Unanswered

Attaching file(s) to Attachment Control

(0) ShareShare
ReportReport
Posted on by 245

Hi,

 

I’m hoping someone can enlighten me if it is possible to attach a file to an attachment control using a selected item of a gallery connected to a document library instead of using the browse function in the control itself?

 

Thanks 🙂

 

 

Categories:
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @MiniMe_83 :

    I've made a test for your reference:

    1\I assume there is a library-picc

    2\I assume there is a list -ListA

    3\I assume the form is a new form

    Step 1: Create a gallery and set it's items property to:

     

    picc

     

    Step 2: Create a flow-GetFileContent(to get the file content):

    1.PNG

    Reference Expression:

     

    data:@{outputs('Get_file_content_using_path')?['body']['$content-type']};base64,@{outputs('Get_file_content_using_path')?['body']['$content']}

     

    Step 3:Add the flow into my app and add a button into the gallery and set it's OnSelelct property to

     

    Set(thefile,GetFileContent.Run("/"&ThisItem.'Full Path').content);
    Collect(TheAttachmentCollection,{DisplayName:ThisItem.'File name with extension',AbsoluteUri:"", Id: "00000000-0000-0000-0000-000000000000",Value:thefile})

     

    Step 4:Set the attachment control's Items property to:

     

    TheAttachmentCollection

     

    and set it's  property to

    2.PNG

    Step 5: Submit the form

     

     

    SubmitForm(Form1);ResetForm(Form1);Clear(TheAttachmentCollection)

     

     

    The Result:

    666.gif

    Best Regards,

    Bof

     

  • MiniMe_83 Profile Picture
    245 on at

    Thank you @v-bofeng-msft, just looking at this now. Obviously your example works, I will try it my end and hopefully come up with the same result.

  • MiniMe_83 Profile Picture
    245 on at

    Hi @v-bofeng-msft 

     

    Im an amateur at best and have fallen at the first hurdle with regards to the Library - Picc set up. This isnt something I am aware of nor can I find online. Is this something easily created?

     

    Thanks for your help as what you have demonstrated is exactly what I would like to incorporate.

     

    Thanks again

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @MiniMe_83 :

    Could you please tell me at which step you encountered difficulties?Is it a step to set up flow? Or you don't know how to create a library in a SP site?

    Best Regards,

    Bof

     

  • MiniMe_83 Profile Picture
    245 on at

    Hi @v-bofeng-msft ,

     

    I can create a document library and can add a gallery but when amending the items section of the gallery, "Picc" isnt recognized as an option in the items setting.

     

    Is there something I need to do to the document library to enable this? 

     

    Thanks again for your help

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @MiniMe_83 :

    First,"Picc" is my library's name,you should use yours.

    Second,you should add the library as your data source first.

    Add a data connection to a canvas app in Power Apps 

    Best Regards,

    Bof

     

  • MiniMe_83 Profile Picture
    245 on at

    Ah, gotcha. I will have another look.

     

    Thanks 

  • MiniMe_83 Profile Picture
    245 on at

    Hi @v-bofeng-msft 

     

    So the issue is the attachment control isn't associated to a list, I've taken the function from a list to save the attachments to another document library, not a list.

     

    The only options in the attachments control properties are:

     

    Name: AbsoluteUri or ID - Currently set to: AbsoluteUri

    Value: AbsoluteUri or ID - Currently set to: ID

     

    Is this still possible?

     

    Thanks for your help!

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @MiniMe_83 :

    Nope,It won't work.

    Best Regards,

    Bof

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard