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 / OnAddFile add file to ...
Power Apps
Unanswered

OnAddFile add file to collection

(0) ShareShare
ReportReport
Posted on by 94

Hello,

 

How to add file to collection when user tries to attach file?

I have custom attachment collection when user press on camera control it adds that image to collection :

 

Set(varImageName, GUID());
Collect(
 colCameraImages, 
 {
 DisplayName: varImageName & ".jpg",
 Id: varImageName & ".jpg",
 Value: Camera1.Photo
 }
);

 

However in some cases users want to use attachment control just to be able to add high quality images.

How can I accomplish that?

Categories:
I have the same question (0)
  • RusselThomas Profile Picture
    4,014 on at

    Hi @flowslcaplikas ,

    On the "Add Image" control, AddMediaButton1, OnChange: property;

    Set(varImageName, GUID());
    Collect(
     colCameraImages, 
     {
     DisplayName: varImageName & ".jpg",
     Id: varImageName & ".jpg",
     Value: UploadedImage1.Image
     }
    );

    Hope this helps,

    RT

  • flowslcaplikas Profile Picture
    94 on at

    If someone is searching for solution without collections as workaround, just add additional form and add toggle. You will have two additional attachments, one with collection attachments and another with default attachment control and after pressing on Submit just submit both forms.

  • RusselThomas Profile Picture
    4,014 on at

    Hi @flowslcaplikas ,

    Did you mean the "add image" control in your original question, or using a form with attachments?

    Kind regards,

    RT 

  • flowslcaplikas Profile Picture
    94 on at

    Hi,

     

    I meant from a form with attachments. I'll add some images to make it more clear:

     

    flowslcaplikas_0-1658172206387.png

    This is a camera control which has property OnSelect:

    Set(varImageName, GUID());
    Collect(
     colCameraImages, 
     {
     DisplayName: varImageName & ".jpg",
     Id: varImageName & ".jpg",
     Value: Camera1_1.Photo
     }
    );

    And if user wants to add additional high quality images he can use Attachment control to "Attach file".

    However, if he tries to add file it turns into "unsaved" and after submit it won't add to collection

    What function I can use to be able to Collect added file to collection (colCameraImages) I guess on "OnAddFile". property?

    flowslcaplikas_1-1658172314226.png

    (attachment property "Items": colCameraImages)

  • WarrenBelz Profile Picture
    155,415 Most Valuable Professional on at

    Hi @flowslcaplikas ,

    You can actually do it all on one attachment control with this really neat process from @RezaDorrani 

     

    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.

    Visit my blog Practical Power Apps

  • WarrenBelz Profile Picture
    155,415 Most Valuable Professional on at

    Hi @flowslcaplikas ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    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.

    Visit my blog Practical Power Apps

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 846

#2
Valantis Profile Picture

Valantis 532

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard