I'm using Cognito forms as a file upload web form to import documents into SharePoint but when I add the file upload fields onto the flow, they are automatically put into a apply to each shell. I have several file upload fields that I want to be able to link to an approval step after the files have been submitted but when they are within the shell, I cannot link to the fields outside of the apply to each.
I'd like to add a new step here, but I'm unable to reach the newly created file in SharePoint as it's been created within the apply to each shell.
Any help greatly appreciated.
Solved! Go to Solution.
Hi @rsymmons
From your message on deleting SharePoint files while trying to reference them inside the loop.
Please try and follow my POC:
A summary:
- I am Initializing an array variable with []
- Next we use the Get file properties under the Create file inside the loop
- Now append the 'Identifier' to the array variable
- Now outside the loop you can create another loop and use the Array Variable as the input
—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others
Proud to be a Flownaut!
Proud to be a Flownaut!
Hi Josh,
Thanks for your response, I'll give this a try tomorrow and see how I get on.
Each file upload field only allows one file attachment however there are several file upload fields in total.
Cheers,
Rob
I've given this a go but not sure I follow the instructions, sorry this isn't quite my thing!
I have 7 "file name" fields and 7 file upload fields to build into this flow. I need to create a copy of the uploaded file in SharePoint so I can create a "link to file" in approvals for our staff to review the doc (they don't have access to cognito forms). After the submission is approved the files are then relocated to another part of SharePoint, under a new heading (folder). I think I'll also need conditions built in to prevent errors when files are not uploaded. Do you think this is possible to achieve in Flow?
I've managed to use a variable in a slightly different way to get the name part of the "apply to each" working, but for file content it missed a small part of the code so the files were unreadable.
Top is the variable version of file content code, bottom is the apply to each version (bottom works):
Proud to be a Flownaut!
This method still wraps the field in a apply to each shell. I'm able to create the file just fine within the shell, it's only when I used an initialize variable and then an append so I can pull the file outside of the shell that I run into issues.
Proud to be a Flownaut!
I guess I'm trying to avoid the loop because I'm unable to access the files using the approval process outside of these loops. I also need to on approval move these all of these files to a new location. This is what we're trying to achieve:
The only part that seems to be preventing me from being able to achieve the above is the inability to access the files created in the sandbox area of sharepoint outside of each of the loops otherwise we would be creating 7 approvals per individual.
Regards,
Rob
Hi @rsymmons
From your message on deleting SharePoint files while trying to reference them inside the loop.
Please try and follow my POC:
A summary:
- I am Initializing an array variable with []
- Next we use the Get file properties under the Create file inside the loop
- Now append the 'Identifier' to the array variable
- Now outside the loop you can create another loop and use the Array Variable as the input
—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others
Proud to be a Flownaut!
Thanks a million that seems to have done it!