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 Apps / Is there a dynamic way...
Power Apps
Unanswered

Is there a dynamic way to show and upload files to SharePoint

(0) ShareShare
ReportReport
Posted on by 3,506

I want to build something as follow inside my Power Apps:-

 

johnjohn123_0-1699221051886.png

 

 

where user do the following:-

 

1) Enter a string representing the designs separated by ",".

2) based on the number of designs (3 in the above example) >> to show Upload files controls inside a gallery

3) where users can upload a file and chose its Design from a combbox based on the values entered inside the text field (Desgins).

4) then the user clicks on submit >> which should submit the text field to a SharePoint list and the 3 attachment files to a SharePoint library.

 

Of course users can enter many designs and not limited to 3, where i need this to dynamically allow to upload files. is this possible inside Power apps? also i need this to work for new & edit scenarios, where users can access the screen and edit the designs attachments or upload new ones.. can anyone help? i know how to upload files from power apps to SharePoint using power automate, my question is how i can handle the attachments and their metadata and pass them to power automate for new and edit scenarios?

 

Thanks in advance for any help. 

Categories:
I have the same question (0)
  • EddieE Profile Picture
    4,641 Moderator on at

    @johnjohn123 

    I have something similar in use that I think maybe what you are looking for? I have a Multi Photo Upload screen, setup like this

    EddieE_0-1699225832558.png

    Steps:

    1. Users add attachments/photos in the lefthand attachment control

    2. the OnAddFile of the control adds new files to a collection

    3. the OnRemoveFile removes files from the collection

    4. User then adds text/metadata per file to be uploaded with the attachment

    5. Save Files creates files in DocLib and adds metadata to the DocLib related to the new file

     

    (note: this is my exact code, you'll need to adjust to suit)

    OnAddFile code

    // Note: my attachment control is called fileUploads
    ForAll(
     fileUploads.Attachments As _files,
    
     If(
     CountRows(
     Filter(colFileUploads, Name = _files.Name)
     ) = 0,
    
     Collect(
     colFileUploads,
     AddColumns(
     Table(_files),
     "togBeforeAfter", "",
     "photoNotes", ""
     )
     )
     )
    );
    

     

    OnRemoveFile code

    ClearCollect( colFilesTemp, colFileUploads);
    
    ForAll(
     colFilesTemp As _records,
     If( 
     Not(_records.Name in fileUploads.Attachments.Name), 
     RemoveIf( colFileUploads, Name = _records.Name)
     )
    )

     

    Gallery on the right Items

    colFileUploads

     

    Save Files button code

    ForAll(
     Ungroup(
     ForAll(
     Sequence(CountRows(fileUploads.Attachments)),
     {
     myRecord: Table(Last(FirstN(fileUploads.Attachments,Value))),
     RowNumber: Value
     }
     ),
     "myRecord"
     ) As _uploads,
     ProjectMulti_PhotoUpload.Run(
     gblCPRecord.Project,
     gblSite, 
     User().FullName, 
     LookUp(colFileUploads, Name = _uploads.Name, photoNotes), 
     "Southern", 
     "Completion", 
     gblSite & "_" & Text( Now(), "[$-en-US]yymmdd-hhmmss" ) & "_" & _uploads.RowNumber & ".jpg", 
     {
     file: 
     {
     contentBytes: _uploads.Value,
     name: _uploads.Name
     }
     } 
    
     )
    );
    
    // clear attachments, refresh ProjectPhotos, navigate back
    Select(icClearImages); Refresh(ProjectPhotos); Back();
    
    

     

    icClearImages code

    Clear(colFileUploads);Reset(fileUploads)

     

    My Flow, it has 2 branches but just showing one

    EddieE_1-1699226705397.png

     

    For the Save Files code, I referenced Chino Does Stuff video, here

    https://www.youtube.com/watch?v=yC0W5am6M3Q&t=1182s

     

    Not 100% sure if this is what you are looking for but may give you some ideas?

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard