-
LFF_ITAsked on March 25, 2022 at 6:58 AM
Hello!
Your file upload widget allows multiple files to be attached. I want to be able to upload multiple files in one go into SharePoint. One of your support team posted this solution:-
Am I right in thinking this will only upload one file into a SharePoint Document Library?
If so, this solution won't work for me, as we have clients who need to upload an unknown number of documents. Can you help with this?
Best regards,
Mike D!
-
Leonidas JotForm SupportReplied on March 25, 2022 at 7:13 AM
Hello Mike D,
Thank you for reaching out to Jotform Support. Base on the thread, one of my colleague also shared the option to upload multiple file into a SharePoint. Please see the image below:
If you need further assistance, please let us know.
-
robertsonldspj11795Replied on March 25, 2022 at 7:24 AM
-
Sheena JotForm SupportReplied on March 25, 2022 at 7:49 AM
Hello robertsonldspj11795,
Thank you for reaching out to Jotform Support. To avoid confusion, I have moved your concern on this thread. I will be assisting you there.
-
LFF_ITReplied on March 25, 2022 at 10:24 AM
Thanks for your response.
So am I correct in thinking that the solution you posted will only upload a single file for each file upload widget? If so I presume it's necessary to change the settings on the widget to have a maximum file upload of 1.
However, this doesn't solve my original problem because our clients need to upload an unknown number of documents. If they definitely needed to upload for example 3 documents, I could use 3 file upload widgets all with the same Power Automate flow. But if I don't know how many they are uploading (it could be 10 even) I don't know how to do this.
Do you think there's a clever way of making Power Automate iterate through multiple files attached to the file upload widget, and create each file in the SharePoint Document Library?
-
LFF_ITReplied on March 25, 2022 at 10:31 AM
Also I really think that Jotform should implement two features:-
- Ability to upload multiple form attachments into a SharePoint Document Library using Power Automate.
- Ability to upload multiple form attachments into a SharePoint List Item as attachments.
There must be huge demand for these two features. I could literally use Jotform for so many more applications if it could do this.
-
John Support Team LeadReplied on March 25, 2022 at 10:47 AM
Hello Mike,
To answer your question, yes, the workaround shared by my colleague in this ticket is meant to send a single file to SharePoint.
Regarding your requirement to upload multiple files, I'm not sure if it's possible, but allow me some time to test this out on my end, and get back to you here with my findings.
-
John Support Team LeadReplied on March 25, 2022 at 2:49 PM
Hi again Mike,
After several tests, I was able to upload multiple files into a SharePoint folder in a single automated flow. I used the same principle as that of solution provided in the ticket shared with you and added/removed a few actions. Here's what I did:
Action 1:
Instead of using 'HTML' format, I used 'Text'.
Action 2:
I used HTTP GET method to capture the URI of the uploaded files. Now, since I used 'Text' format, the result will be an archived file (zip):
instead of hyperlinks being provided when using 'HTML' format:
Action 3:
Here I initialized a variable I called "getURL" extracting the value from the HTTP GET action. This results into the actual URL of the archived file.
Don't forget to configure run after settings to include "has failed":
Action 4:
Here I used HTTP GET method again then selected the variable I just created from Action 3 as the URI
Action 5:
This one's optional but I find it handy to create the filename on a separate action. In this particular action, I just concatenate the "name" field in the form with the "submission ID" as the unique filename of the archive:
The filename depends on how you prefer it to appear in SharePoint.
You may learn more about this function here.
Action 6:
Now here's the exciting part. I have used 'CREATE FILE' action in SharePoint and used the output from the action 5 as the filename appended with ".zip":
And the BODY of HTTP method in action 4 as the file content:
This will be created in SharePoint:
Action 7:
Now, since a zip file was created in the SharePoint folder I just defined in the previous action, I'll now extract it into a separate folder that'll contain the actual uploaded files:
This will be the result:
Action 8:
And lastly, I have created an action to delete the archived file so only the extracted ones will be retained:
I used 'ID' as the file identifier which can be found from searching 'ID' in the Create File action's content:
And that's it! I have implemented this on my test form and it worked as intended.
Please try it on your end, too and see if it'll work for you.
-
LFF_ITReplied on March 28, 2022 at 10:58 AM
That is indeed a very clever workaround @JohnRex. I will implement this soon and let you know how it went. Many thanks for this!