Hope to help, let me know if you have questions.
**I want to take responses from a FORM to copy an existing folder,
Do you want to rename the Copy or rename the original?
Do you mean, move the renamed (original folder), or renamed (copied folder?)
**rename it as one of the responses and drop it in another folder.
Let's see if this helps you and you can come back and let me know what part is incorrect. Hopefully we can
Scenario
Let's first pretend you have a Form 12345
On the form you have a Question below
Question 1: What Folder do you want to make a copy of?
Answer: FolderToCopy
Question 2: What folder would you like to copy this folder too?
Answer: FolderToCopyTo
In SharePoint you have the folder Foo
Now, first let me explain what we need to do, then show you.
1. Create a Flow with an Automated Trigger - When a Form is Submitted
2. To make it clean, let's create a string Variable called CopyFolderName and we want to initialize it with the Dynamic Value of the Question for the Folder to Copy
3. Let's create a second Variable called it - NewFolderName and we want to initialize it with the Dynamic Value of the Question for the Folder Copys Name
4. Add a List Folder SharePoint Action
--This will allow us to see if the Folder, that we want to save copies too, already exists.
Now this is where it gets fun... You see, if the folder exists, you won't get an error. If it does NOT exist, you will get an error.
So how do we handle this?
Answer: we are going to configure Step 5 to only run if step 4 Fails
Next, if Step 5 is skipped (because step 4 doesn't fail), we still need step 6 to run
So we will configure it to run, whether Step 5 is Success or is Skipped
This will make perfect sense in the visual section of this walkthrough.
5. We will add our Create Folder Action
-again we would only want this to Activate, if the previous step fails, telling us we need to create it, otherwise we would want to skip to step 6.
Now we want to copy our folder, as we know our "copy to folder" exists for sure
Now, to do this, we are doing to use the Get Metadata for the Folder. This is a good education piece as well. Just like files have Identifiers, so do Folders. Essentially, they are the same thing but for different object types.
6, Add a Get Meta Data
--Input our Site, and our Folder Path. The path will be a combination of your default root structure, like /Shared Documents and then we would put /VariableName, where the VariableName is the CopyFolderName that we created in step 2 above
7. Now finally we do our Copy Folder
Add a Copy Folder SharePoint Action
--we fill in the site
--but for the Folder (to copy aka source), we will use the Dynamic Property caled Id (not ItemId) from step 6. As a matter of fact, it will be one of the only things you even can add here
And Done. Please see below for visual steps
Here is my Sample setup for you
Now here is my sample flow
I created a Sample Form, with just 2 questions, Folder Name and New Folder Name. Now I don't know how you are doing it, if its a Single Select Choice or something but the result would be the same (a text answer)
Next is my PA Flow - Part 1
NOTE: Each part is just in order in the flow, so just build them in the order I have them here.
1, I created my automated flow trigger
2. I retrieved the response details
3. I grabbed the answer to what folder to copy
4. I grabbed the copied folder name to use
Now for Part 2
I created a SharePoint folder (so we could copy it) and added a couple of files
Part 3
So now we have to get the details for the folder we want and copy it.
Now, we don't have any variables for the SharePoint site name, or Document library in this example, but that would be something you could do with Environment Variables
Now we need to use the Get Metadata for the Folder so we can use the Id of the folder in our Copy
Then I added my Copy Folder and in the Folder to Copy, i used the Dynamic Id property (not ItemId) from the Get folder metadata above it
NOTE: and this is important to notice
For the Site Address, since we didn't have Environment Variables, I just picked my Sites (and then blocked it out here)
Next, I added the /Share Documents/ and then I added the proper Variable depending on whether I was pointing at the Source Folder, or the CopyToFolder
Ok, so how did I add in the Parallel Action
Under List Folder, I first Added Create new folder
Now Part 2 of this though.
Now click on the three ... on Get Folder Metadata and click Configure Run After. Make sure Only Success is checked. This makes sure this side only runs,
So before we see the steps in order lets see how i configured step 5 (Create new folder) and step 6 copy folder
Click Configure to Run (this is for Create new folder) and its set to only run if List Folder Fails, which means the folder doesn't exist, so yes create it
Now for Get Folder Metadata, which we want to run whether Step 5 runs or not because we need it to Copy the Folder property
And Now the Steps in the flow
One this is one you can see that the Copy To Folder now exists (it did not on my first run) and it copied the Folder and its Sub-Parts (the 2 Files)
Here is before and after pictures
In picture 1 you can see I have no Folder called FolderToCopyTo
Now after my run, it created the FolderToCopyTo folder, then copied FolderToCopy and its files under it.
And Our full Flow
Cheers, let me know if you need any more help
-Michael