How to upload the files in a submission to Sharepoint through Power Automate?

  • S_Lorusso
    Asked on May 31, 2020 at 3:16 PM

    What I am trying to do is in this link.  I copied the link from your forum. the final answer is not showing.

    https://www.jotform.com/answers/2179095-How-to-upload-attachment-and-PDF-report-using-Power-Automate

     

    I am able to get the folder created, but I am having difficulties getting the the form and any uploaded files to show up correctly in the folder.

     

    This is a link to the SharePoint website with the functionality available for use with Microsoft Power Automate

    https://docs.microsoft.com/en-us/connectors/sharepointonline/#get-file-content

    Scroll down to "Actions". I have tried a few of the Actions, but I am not having any success. I feel like I am close.

     

    Here is the flow setup in Microsoft Power Automate

    I have tried "Output Format Item" of both "HTML" and "Text"

    1590953720Flow Setup Screenshot 10

     

    It partially works, as it creates the folder.

    This is the Project folder it created in Sharepoint, called "Shawn" with the file that it creates in there.

    The file i am uploading in the Jotform is called "AutoCAD - Symbols"

    1590953887Folder with File Screenshot 21

     

    When I click on the file it launches Adobe Acrobat, and gives me this error.

    1590954016File error message Screenshot 32

     

     

  • Jimmy_D
    Replied on May 31, 2020 at 7:15 PM

    The issue is probably due to account privacy settings. Can you please make sure the "Require log-in to view uploaded files." options is unchecked? This can be found on your Account Settings page.

    How to upload the files in a submission to Sharepoint through Power Automate? Image 1 Screenshot 20Try this an let us know if the issue persist. 

  • S_Lorusso
    Replied on May 31, 2020 at 7:47 PM

    I unchecked the box and did a new form submission. I still have the same problem.

    Also, why is the file name not coming across as the actual file name, "AutoCAD - Symbols" and instead coming across as the image below.

    Once I get the file to come across correctly, I will need the correct name too. There is no way we can manage this like this.

    1590969059Screen Shot 2020 05 31 at 4 Screenshot 10

     

  • Kiran Support Team Lead
    Replied on May 31, 2020 at 10:52 PM

    Please allow me some time to check on this and get back to you with relevant information. 

    Thank you! 

  • Kiran Support Team Lead
    Replied on May 31, 2020 at 11:34 PM

    As I am not having a Sharepoint account, I have tried testing a File upload form to connect to Google Drive using Microsoft Power Automate. It looks like the issue is with the file upload field is sending the complete URL of the file uploaded. This is why the file name is displaying with the URL. 

    Since you are already using Single file upload fields on the form, you may try adding a Short Text entry field to the form to copy the file name of the uploaded file to it by setting up a condition as below:

    159098238220200601 085839 Screenshot 10

    This File Name field can be mapped to the File Name in the Flow. Please give it a try and let us know if you need any further assistance. We will be happy to help. 

  • S_Lorusso
    Replied on June 2, 2020 at 5:46 PM

    this did not work? is there a senior tech support agent that might know more about getting files into Sharepoint?

  • S_Lorusso
    Replied on June 3, 2020 at 10:23 AM

    hello? any response?

  • Kiran Support Team Lead
    Replied on June 3, 2020 at 11:29 AM

    We have forwarded the ticket to one of our support team members who has access to the Sharepoint to test further. As soon as we have any news in this regard, we'll let you know. 

    Sorry for the trouble caused.

  • Elton Support Team Lead
    Replied on June 7, 2020 at 4:11 AM

    @S_Lorusso

    Here's my workaround in order to successfully a create file on SharePoint through Power Automate.

    1. First, you have to get the file name of the uploaded file the same as suggested by my colleague, Kiran but this time using Form Calculation Widget.

    Example:

    How to upload the files in a submission to Sharepoint through Power Automate? Image 1 Screenshot 100

    2. Now on Power Automate, here's how the entire flow looks like to get the Create File to work on Sharepoint after following this suggestion from MS Community.

    How to upload the files in a submission to Sharepoint through Power Automate? Image 2 Screenshot 111

    A. The first action is of course JotForm when a response is submitted.

    B. Use HTTP to get the file then the Method should be GET and the URI should be the single file upload field from your form. Example:

    How to upload the files in a submission to Sharepoint through Power Automate? Image 3 Screenshot 122

    C. The 3rd action is the tricky part so please follow the same as shown below. Simply add a Variable then select Initialize variable. Example:

    How to upload the files in a submission to Sharepoint through Power Automate? Image 4 Screenshot 133

    Name the variable you want, select type String, then enter this on value as Expression.

    actions('HTTP').outputs.headers.Location

    How to upload the files in a submission to Sharepoint through Power Automate? Image 5 Screenshot 144

    After that, open this action setting then Configure run after

    How to upload the files in a submission to Sharepoint through Power Automate? Image 6 Screenshot 155

    And select has failed

    How to upload the files in a submission to Sharepoint through Power Automate? Image 7 Screenshot 166

     

    D. On 4th action, add another HTTP GET method then select the variable you just created from Step C on URI

    How to upload the files in a submission to Sharepoint through Power Automate? Image 8 Screenshot 177

    E. Finally, Create file on Sharepoint with File Content from 2nd HTTP Body (see image below). Also, the File Name should be the field you created on Step 1.

    How to upload the files in a submission to Sharepoint through Power Automate? Image 9 Screenshot 188

    This works for me after running several tests. If you're stuck at some point on the guide above, please let us know.

    Regards!

  • S_Lorusso
    Replied on June 8, 2020 at 9:59 AM

    This looks rather complicated. before I go and implement al of this, will this be able to bring in the 8 individual uploads that I have on the Jotform? and will it also work for the 1 pdf file that the jotform generates from the submission?

  • Ashwin JotForm Support
    Replied on June 8, 2020 at 11:23 AM

    The workaround shared by my colleague is for one uploaded file. If you want to allow users to upload multiple files, you need to add separate file upload filed in form and follow the same process for each file upload field. 

    Do try it out and get back to us if you have any questions.

  • S_Lorusso
    Replied on June 8, 2020 at 2:47 PM

    Hello

    Ok... I had to tweak a little, but I got the folder created and the file to come over. 

    Now, as part of this, how do I get the PDF document that Jotform creates as part of the submission to also carry over to Sharepoint.

    And to explain it differently, I received the uploaded document that someone attached, perfect, but I also need a copy of the JotForm questionaire PDF that jotform creates each time a form is submitted to carry over to sharepoint.

     

    1591644303File Name Screenshot 10

     

    POWER AUTOMATE SETTINGS

    15916443521   Jotform Screenshot 21

    15916444052   HTTP Screenshot 32

     

    15916444253   Initialize Variable Screenshot 43

     

    15916444464   HTTP 2 Screenshot 54

     15916448505   Create File Screenshot 65

     

  • Kiran Support Team Lead
    Replied on June 8, 2020 at 4:02 PM

    We are sorry that there is no direct way to send the PDF document created for the submission to the integrated service. However, I think we can achieve this by a workaround using the direct PDF report link in the format below:

    https://www.jotform.com/server.php?action=getSubmissionPDF&sid={id}&formID=99999999

    Please allow me sometime to check on this and get back you. You may give a try using the URL to get the PDF document uploaded to Sharepoint.

    Thanks!


  • S_Lorusso
    Replied on June 10, 2020 at 4:37 PM

    I

    have all of this working. Great. thank you.

    Now......how can this be modified to get the PDF of the form submission too?

  • Elton Support Team Lead
    Replied on June 10, 2020 at 6:04 PM

    Glad to hear that it's working now. We will answer your other question about creating the PDF submissions into a separate thread here https://www.jotform.com/answers/2381370. We'll be on it shortly.