Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Suggested answer

Upload multiple files to sharepoint libary in a folder defined by a text input.

(1) ShareShare
ReportReport
Posted on by 144
Hi,
Wondering if anyone could help?
 
I'm using Shane Young's videos on Youtube to work out how to pass multiple files using the V2 connector but can't seem to understand how to add these all in one subfolder in my document libary based on a text input called job number.
 
My code is this but how would I would pass the text input just the once and put all the files in my attachment control in a sub folder with the input's name?
 
ForAll(
    AttachControl.Attachments As FILE,
    ServiceJobsDocLibary.Run(
        {
            file: {
                contentBytes: FILE.Value,
                name: FILE.Name
            }
        }
    )
);
  • MooseBot88 Profile Picture
    144 on at
    Upload multiple files to sharepoint libary in a folder defined by a text input.
    Im still struggling with this, anyone able to help me?
  • MooseBot88 Profile Picture
    144 on at
    Upload multiple files to sharepoint libary in a folder defined by a text input.
    Im not great with JSON but i'm guessing you mean something like this for the flow....

    What would I put in the parse JSON function, then in the apply to each use the body to put into the create file action? Or am I completely wrong?
     
  • Suggested answer
    SpongYe Profile Picture
    5,580 Super User 2025 Season 1 on at
    Upload multiple files to sharepoint libary in a folder defined by a text input.
    Hi,
     
    Your flow will consist of two parts: first, creating the subfolder, and second, placing all the attachments into it.
     
    Collect all the attachments, transform them into JSON, and send them to Power Automate.
    In your flow, first create the subfolder, then loop through the attachments to add them to the subfolder.
     
    So, it would look something like this: 
     
    ForAll(
        AttachControl.Attachments As FILE,
        Collect(
            ServiceJobsDocLibary,
            {
                file: {
                    contentBytes: FILE.Value,
                    name: FILE.Name
                }
            }
        )
    );
    
     ServiceJobsDocLibary.Run(
       TextInput_JobNumber.Text,
       JSON(ServiceJobsDocLibary) 
     );
     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard