Create a file and folder then move created file into that folder

Brass Contributor

Hello All,

 

I have a case where I need a power automate to create a file  and folder in SharePoint site and then move the created file into created folder..

 

I have followings:

A SharePoint list

Customer Exist: Yes, No

Customer name: List of customers(only one customer can be selected)

Few other fields (which are not important here)

 

Solution:

If a user selects the Customer Exist: "Yes". 

Flow will create a file and move the file into the folder. The folder name is the same as the customer name.

If user selects Customer Exist: "No"

Flow will create a file and a folder(Folder name will be the same name as customer name), then move the created file into the created folder at this step.

 

Looking forward to hearing from you.

 

Thanks

1 Reply

@Naligurtan 

 

List - Test2

Customer: Lookup field to Customers 

Customer Exists: Choice Yes or No 

 

Library - CustomerFolders

 

Does the flow run- when an item is created, or modified, or when a condition is met? You'll need the right trigger and maybe a trigger condition.  I set it to manually start and you enter the ID.

PamDeGraffenreid_0-1679544593889.png

Create the content for the file.  We'll use this to create a text file.

PamDeGraffenreid_3-1679545154156.png

 

Create a variable for the folder path - /DocumentLibraryName/CustomerName

PamDeGraffenreid_1-1679544692986.png

 

Use a condition to see if the customer exists.  

Check to see if the Customer Exists = Yes

If yes, create the file.

Otherwise, create the folder, then create the file in the new folder.

PamDeGraffenreid_4-1679545287071.png

 

Hopefully this is enough to get you started.  There is a great Power Automate community here. https://powerusers.microsoft.com/t5/Forums/ct-p/FL_Comm_Forums