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 / Update Flow to Upload ...
Power Automate
Answered

Update Flow to Upload Attachment to Specific Nest Folder in Library

(0) ShareShare
ReportReport
Posted on by 5,325 Super User 2025 Season 2

Need:
I have the need to dynamically decide to which Folder/Subfolder in a Library an attachment is uploaded.

Background:
I have a Flow that creates a Folder and Nested Folders whenever a new item is created in a SharePoint List.

This function works fine.

I, also, have a Flow that is uploading attachments to a specific Subfolder. That function works fine.

I would like the ability to upload the attachment to a specific Subfolder assoicated with the name of the individual, as chosen in the Gallery. All attachments should be routed to the Root folder associated with the name of the client, and uploaded to the Subfolder associated with the 'type' of document being uploaded.

Components: 
My 'Upload Attachments' button has the following formula -
UploadClientAttachmentsFlow.Run(Upload_Client_ID_Fld.Text,Label15.Text,TextInput1_3.Text,
{ file: {
          contentBytes: First(Client_Attachments_Control_2.Attachments).Value,
                      name: First(Client_Attachments_Control_2.Attachments).Name
         }
});

The user has the ability to choose, from a Dropdown box, the type of attachment being uploaded. That choice is also used in the naming of the file when it is uploaded to the Library.

Example:
If the user wants to upload a 'Drivers License' (as chosen in the Gallery), related document associated with client 'Olive Oil' (as chosen in the Gallery), the Flow should route the document to the Root folder for 'Olive Oil' and add it to her 'Drivers License' subfolder.

My Power Apps Attachment Upload Gallery -

Phineas_0-1698601097872.png


My 'Upload Attacments' Flow -

Phineas_1-1698602500665.png


My preferred upload folder/subfolders -

Phineas_2-1698602646282.png

Phineas_3-1698602690982.png

 

Categories:
I have the same question (0)
  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @Phineas 

     

    You need set the "Folder Path" dynamically in Create file action. Here is an example:

    ManishSolanki_1-1698636059568.png

    Using expression, I have set the folder path dynamically:

    concat('/Shared Documents/',triggerBody()['text'],'-',triggerBody()['text_1'],'/',triggerBody()['text_2'])

    Similarly, pls set the folder path dynamically as:

    concat('/<<SharePoint document library name>>/',<<ClientID Input variable>>,'-',<<ClientName input variable>>,'/',<<DocumentType input variable>>)

    Note: You need to pass the input parameters from canvas app: client Id, client name, document type folder name etc.

     

    Pls modify the flow & retest it.

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at

    I'm passing those fields already in the Power Apps (V2).

    How would the 'Folder Path' formula look based on the below?

    Phineas_0-1698683297917.png

     

  • Verified answer
    ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @Phineas 

     

    I would suggest passing ClientName from the drop down to the power automate as another input parameter. You need to find the logic to get the document type folder name from the document name input parameter (may be lookup from excel or SharePoint site). Using these 2 input parameters, you could set the folder path dynamically in create file action as mentioned in my previous reply.

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

     

     

  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at

    I created another Dropdown in the Power Apps Gallery called 'Folder Name' that has the names of all the sub-folders.

     

    I've had issue with adding things to my flow and the flow formula in Power Apps.

     

    Can you advise, based on the images I have provided, how to update the Flow trigger, Flow create folder, and Power App button formula?

     

     

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard