Hello everyone
I would like to know how to get the answers to a form:
If the person has never filled in the form it creates a folder with their name on it
and if the person comes back and fills in the form again, the file is not created.
This is what I currently have as a flow :
Hi @Anonymous ,
Wow, I had to re-read what I typed from last year.
I used the variable as a flag because I think in your original post, you wanted to not recreate the file if the folder with the person's name exists. This is one of many ways of achieving the goal and allows you to place your business logic/actions outside of the loop if required.
You could also use an expression to get the count and use a condition as well.
--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up
Connect on LinkedIn
Just question : why in the first condition if yes we set a variable to true ? What the goal ?
@eric-cheng This is very helpful but not quite working for me.
My scenario is slightly different. I want users to be able to submit a form and for these details to go into a list item on Sharepoint. This part is done. But in the form there is an option to upload documents. I want a flow that creates a folder for this list item, adds these documents to it and then adds a link to the folder location in the list item column called 'Folder'. This is so that the person assigned to respond to this task can click on the folder location easily, using the list essentially as a dashboard.
However, instead of triggering this flow when the form is submitted I am attempting to replicate this for when a new list item is added. This is because there will be occasions when we need to manually add a list item within Sharepoint rather than it come through the form submission. I still want the folder to be generated automatically to ensure consistency in folder naming but the actual files will need to be added manually to the folder in this case.
So this is what I'm thinking:
1. When an item is created
2. Get item
3. Create new folder
4. Create file
5. Create sharing link for a file or folder
6. Update list item
However, I don't know what to put into steps 4 - 6. Wondered if you could expand on the step you posted about below and maybe offer some other pointers? I haven't included the set variable etc steps because I don't think I need these but may be wrong. Many thanks.
Is this the name of the folder I want to create or the name of the folder where responses are sent? Do you have an example?
Hi @Anonymous ,
The value/field with the folder name
--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up
Connect on LinkedIn
Thank you for your answer, just a question what do you mean by Forms field ?
Is this the form id link ?
Hi @Anonymous ,
Try the below flow and assume Q1 is the name of the respondent
1) Initialize a boolean variable and set it to @false
2) Use a Get Files (properties only) action to get all files and folders from your document library. Add an ODATA filter FileLeafRef eq 'Q1' (replace Q1 with your Forms field). FileLeafRef is the internal name for name in SharePoint.
3) Loop through each returned file and add a condition for IsFolder = true. If true, it means a folder was found with the name. Set the boolean variable to @false
4) Exit the loop and add another condition to check your boolean variable. If false, it means no folder was found and you can proceed to create a folder and add a file (same logic that you already have).
Run for first form submission which will create a folder and file
Run for second submission with same name which will skip
--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up
Connect on LinkedIn
Hi @eric-cheng
How to make sure the file isn't created again when the user submits the form the second time
Hi @Anonymous ,
Can you clarify whether you are asking:
1) Why the file isn't created when the user submits the form the second time
2) How to make sure the file isn't created again when the user submits the form the second time
--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up
Connect on LinkedIn