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 / Upload attachments sub...
Power Automate
Unanswered

Upload attachments submitted through SharePoint List into a specific folder within Document Library

(0) ShareShare
ReportReport
Posted on by 4

Hello,

 

This is my first time posting here but I am a long-time lurker.  Forgive me because I have no diagrams or photos to offer as I am lost on where to even get started, but I am needing help with creating a workflow that seems a little complex and I am not sure if its even possible.  I have a SharePoint list where users submit requests to my team to conduct a QC review.  When they submit the item, they fill out a form and include the documents that need to be reviewed as attachments.  One of the columns in the form is a drop down where users can select their respective department name, which there are over 50.  I currently have an automated flow that runs each time a submission is created that takes the attachments submitted, creates a new folder within a single document library within my SharePoint, names the folder as Submission ID# - Department Name - Request Type, and then deposit the documents within that folder.  This has worked with no issues so far, but it is getting very messy to sort the folders by department name and the number of submissions we are receiving has started to grow.  I am trying to organize this a bit better and created multiple folders within the single document library, labeled by the departments name (i.e. HR, Risk, Customer Service), and started manually moving items into their respective departments folders.  I would very much like to automate this so that any time a new item comes in, it routes to the respective folder.  Is there a way to setup a flow that could match the department name on the submission form to the department name on the individual folders within the document library and essentially do the same thing: Create a new folder, within the department folder, name the folder Submission ID# - Department Name - Request Type, and deposit the documents that were attached in the submission.  

 

TL;DR:  Looking for an automated workflow that would take documents attached by a user through a submission form, and deposits them into a new folder within an existing folder, within a document library, by matching the department name on the submission form and the existing folder.  

 

I hope this was clear, but I am happy to elaborate further if needed.  Thank you in advance for any help that you can provide.

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

    Hi @sjajja 

     

    It looks like you are looking for creating a parent folder with department name. The attachments from the new submission will be saved based on the department value selected in the list item. If that is the case, then you can simply create dynamic folder path by adding the department value in the existing flow.

    ManishSolanki_0-1709265327333.png

    /Shared Documents/HR/<existing folder path in flow>

    You need to dynamically pass the department name value in between the library name & existing folder path. So, just replace 'HR' with actual department name value from list in the above folder path.

     

     

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

     

  • v-yetonggu-msft Profile Picture
    on at

    Hi @sjajja ,

    I created a flow that can help you automatically put the 'Submission ID# - Department Name - Request Type' folder into the department folder.

    My SharePoint Library:

    vyetonggumsft_9-1709267646957.png

     

    vyetonggumsft_10-1709267662277.png

     

    vyetonggumsft_11-1709267679997.png

     

    vyetonggumsft_12-1709267694261.png

    My Flow:

    vyetonggumsft_0-1709266932673.png

    vyetonggumsft_8-1709267504140.png

     

     

    FSObjType eq 1

     

     

    vyetonggumsft_0-1709271366167.png

     

     

    body('Filter_array')
    
    body('Filter_array_2')
    
    item()?['{Name}']
    
    substring(items('Apply_to_each')?['{Name}'], add(indexOf(items('Apply_to_each')?['{Name}'], '#'), 4), sub(sub(nthIndexOf(items('Apply_to_each')?['{Name}'], '-', 2), 2), add(indexOf(items('Apply_to_each')?['{Name}'], '#'), 3)))
    
    items('Apply_to_each')?['{Name}']
    
    length(body('Filter_array_3'))
    

     

     

    Best Regards,

    Sunshine Gu

  • sjajja Profile Picture
    4 on at

    Hi Manish,

     

    And thank you for your reply!  I have over 50 department names, would I have to do this for each department then?

     

    Thank You,

    Shaan

  • sjajja Profile Picture
    4 on at

    Hi Sunshine,

     

    I am getting stuck on the code you provided.  On Filter Array 3, I am not able to populate {Name} like you did.  Screenshots included, but can you let me know what I am missing?

  • v-yetonggu-msft Profile Picture
    on at

    Hi @sjajja ,

    This '{Name'} is not a dynamic content that is populated by a option, it is an expression that is written.

    vyetonggumsft_0-1709518553736.png

    item()?['{Name}']

     

    Best Regards,

    Sunshine Gu

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