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

  • Profile Image
    S_Lorusso
    Asked on May 31, 2020 at 03: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.png

     

    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.png

     

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

    1590954016File error message.png

     

     

  • Profile Image
    Jimmy_D
    Answered on May 31, 2020 at 07: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.

    Try this an let us know if the issue persist. 

  • Profile Image
    S_Lorusso
    Answered on May 31, 2020 at 07: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.50

     

  • Profile Image
    Kiran
    Answered 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! 

  • Profile Image
    Kiran
    Answered 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.png

    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. 

  • Profile Image
    S_Lorusso
    Answered on June 02, 2020 at 05:46 PM

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

  • Profile Image
    S_Lorusso
    Answered on June 03, 2020 at 10:23 AM

    hello? any response?

  • Profile Image
    Kiran
    Answered on June 03, 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.

  • Profile Image
    EltonCris
    Answered on June 07, 2020 at 04: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:

    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.

    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:

    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:

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

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

    After that, open this action setting then Configure run after

    And select has failed

     

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

    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.

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

    Regards!

  • Profile Image
    S_Lorusso
    Answered on June 08, 2020 at 09: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?

  • Profile Image
    ashwin_d
    Answered on June 08, 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.

  • Profile Image
    S_Lorusso
    Answered on June 08, 2020 at 02: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.png

     

    POWER AUTOMATE SETTINGS

    15916443521 - Jotform.png

    15916444052 - HTTP.png

     

    15916444253 - Initialize Variable.png

     

    15916444464 - HTTP 2.png

     15916448505 - Create File.png

     

  • Profile Image
    Kiran
    Answered on June 08, 2020 at 04: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!


  • Profile Image
    S_Lorusso
    Answered on June 10, 2020 at 04: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?

  • Profile Image
    EltonCris
    Answered on June 10, 2020 at 06: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.