cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
slingin_simmo
Level: Powered On

Creating SPO folder with the name taken from metadata field

I am using flow to automate a few tasks within SPO already, but only starting on my MS Flow journey.

Background info first:

* In the UK, we use National Insurance numbers for each employee, with the following format QQ012345C.

* My organsiation has a doc library with a bunch of folders in there like so:

Employee Folder 0

Employee Folder 1 etc

Employee folders are sorted by the first digit in the respective employee's national insurance number (NINO).
E.g.
JN123456C would be found in the library 'Employee folders 1'.

Now for the flow requirement:

When a file in a specific doc library has the national insurance number added to the file, I would like flow to check the correct employee folder to see if the folder with the NINO number already exists, and if it does not create it and put the file in it. If it does exist, just move the files in to it.

 

I am having trouble finding a way to:

1. have flow check the correct folder

2. create a spo folder

 

I understand how to get the metadata i want to play around with from the doc library, but not how to use that and get the first integar to then check this against the employee folders etc.

Any help would be appreciated on how I can make this work, or if there is another alternative I should be using instead of Flow.

 

Thanks to all who take the time to respond.

6 REPLIES 6
Community Support Team
Community Support Team

Re: Creating SPO folder with the name taken from metadata field

Hi @slingin_simmo ,

 

I want to know "has the national insurance number added to the file" refers to whether the national insurance number is included in the file content or the national insurance number is included in the file name.

 

I am still confused about the structure you describe, please provide more details to describe your requirements.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
slingin_simmo
Level: Powered On

Re: Creating SPO folder with the name taken from metadata field

Thanks for taking the time to respond Barry. Really appreciate it.

The NINO is not in the file name. It is a metadata field on the properties of the file. Here is a screenshot as an example:

NINO.PNG

The idea is that on each file that has the NINO added, an automated task can then run to move this file to a folder which has the NINO as the name in another doc library.

Here is the doc library it will be moved to:

EMP_FOLD.PNG

So because that NINO in the example has SL012345CC.

That first zero means it needs to be moved to the Employee_Folders_folder.

I need it to seach the correct employee folder for the foldername with the NINO, and if it doesnt exist, create it. If it does, move the files in to it.

I think I can get the part about moving the files, but I need help with the searching the correct Employee_Folder_* folders and creating it if its not there.

 

Make sense?

Community Support Team
Community Support Team

Re: Creating SPO folder with the name taken from metadata field

Hi @slingin_simmo ,

 

From your screenshot, Employee folders are more like SharePoint Library, right?

 

Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
slingin_simmo
Level: Powered On

Re: Creating SPO folder with the name taken from metadata field

Yes, they are folders within a seperate SPO Document Library.

Community Support Team
Community Support Team

Re: Creating SPO folder with the name taken from metadata field

Hi @slingin_simmo ,

 

I mean Employee_Folders_0 is a SharePoint Library and not a Folder in the SharePoint Library.

Or Employee_Folders_0 is a Folder Name, right?

 

Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
slingin_simmo
Level: Powered On

Re: Creating SPO folder with the name taken from metadata field

YEs you are correct, they are currently Doc Libraries.

But I have no problem with making these folders within 1 doc library if that makes things easier.

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,979)