Error Importing into Google Drive

This is my first time working with google drive, and I am attempting to import a test file and am receiving the following error. Is this error something to do with my API setup in Google, or is this something to do with my import step in Celigo? Any help is greatly appreciated!

0

Comments

6 comments
Date Votes
  • Dave Guderian can you screenshot your import setup? What are you trying to do?

    0
  • Hey Tyler-

    I should have been more descriptive in my original post. The error is being generated on a test run. I am using the marketplace import step (Insert files to G drive). Part of my confusion is also what part of the import I am defining what I want to import. I see where I can define the directory path and the file name, but where am I actually telling the import step what I want to import?

    Here are a few screenshots of my setup:

     

    0
  • Dave Guderian couple issues here:

     

    Lastly, when you say you are doing a "test run" do you mean using TEST MODE or just running with sample data while the flow is on?

    0
  • Hey Dave Guderian, the pre-built flow step that you picked from the marketplace is for transferring raw/blob files that were first retrieved via a 'transfer' flow step in your flow. Following is a flow in the marketplace that first downloads raw files, and then uploads them. The upload assumes you already did a download somewhere in your flow, and it knows how to get the files from the download, etc...

    Now, if you want to see an example of a pre-built flow step that is dynamically building the file that you want to upload (i.e. from the records in the flow), then check out this pre-built flow step: "Create new Google Sheet and upload records into it". This flow step builds a CSV file, and then uploads it to Google Drive, and then it sets the "Mime type" to "Google Sheets" to instruct Google to transform CSV to Google Sheets, etc... You can change of course change any of these settings.

    0
  • Hey Scott and Tyler-

    Thank you for the help on this. Unfortunately I am still confused on exactly how to grab a file to pass through a flow and haven't had much success over the past couple of days since we discussed it in office hours (so I apologize as this post is lengthy, but hopefully you can pinpoint what I am doing incorrectly and maybe others have had the same issue).

    Couple notes: I have replaced the actual URL of where I would will be pulling the file with a public URL. Maybe this doesnt work and where I am going wrong, but not sure. The public URL (as seen in the payload) is: https://s29.q4cdn.com/175625835/files/doc_downloads/test.pdf. I am also trying to do this with the integrator.io (using the mirror endpoint) but am thoroughly confused on it, so I have a feeling this is also a point where I am doing something wrong!😁

    Okay... on to the screenshots

    Step 1: Payload coming out of my export step post transformation below. I have three arrays where there will/could be attachments. I have grouped these into there own individual object arrays thinking that it will eventually be easier for imports using "one to many" when I eventually get there. The three object arrays that contain attachments are: W9 Attachment, EandOAttachment, and LicenseAttachment. I have put the sample URL in the EandOAttachment array. I am hoping this structure works, but please let me know if you suggest something different.

    {
      "BrokerageOrIndividual": {
        "BrokerageHouseOrIndividual": "Individual",
        "BrokerageHouseDBAName": "Brokerage House DBA Name",
        "BrokerCompanyName": "Broker Company Name",
        "NPNNumber": "Broker NPN",
        "FEIN": "FEIN",
        "LicensedStates": [
          "Maine",
          "Maryland",
          "Nebraska",
          "North Carolina",
          "Tennessee",
          "Utah"
        ],
        "BrokerageHouseFileName": "Brokerage House DBA Name-thebomb@thebomb.com",
        "BrokerFileName": "BrokerFirs BrokerLast-thebomb@thebomb.com"
      },
      "DemographicInformation": {
        "FirstName": "BrokerFirs",
        "LastName": "BrokerLast",
        "Street": "1234 Broker of the Year Drive",
        "City": "Omaha",
        "State": "Nebraska",
        "ZipCode": "34343",
        "Email": "thebomb@thebomb.com",
        "Phone": "(342) 242-3232"
      },
      "W9Attachment": [
        {
          "Attachment": "https://www.cognitoforms.com/fa/E-kKzFckmUO4P5GWf49ESQ?token=GGCAhuF2qT31vcUbM7YevMgJFhIe9_dv1HEYafADOdAvSHxFRVQnDxw4Pl9wflVg3VDGIYgwbl05G29gTZUwpA$$",
          "Type": "W9Form"
        }
      ],
      "EandOAttachment": [
        {
          "Attachment": "https://s29.q4cdn.com/175625835/files/doc_downloads/test.pdf",
          "Type": "EandOInsurance"
        }
      ],
      "LicenseAttachment": [
        {
          "Attachment": "https://www.cognitoforms.com/fa/E-kKzFckmUO4P5GWf49ESQ?token=nklx-kV5k6BhIlOwCYZvkzpxbAU_v3FecyAEfG-UXUJ3qW1_JYhWLbg_pfcrOVgO6-N1jb9BlnPJA06r9Rk9Ew$$",
          "Type": "LicenseDetailsByState"
        }
      ],
      "BankInformation": {
        "AccountType": "Checking",
        "BankName": "Test Bank",
        "AccountNumber": "21321321312",
        "RoutingNumber": "21321321321"
      }
    }

    Step 2: This first "step" in the flow (i.e. right after the export step). This is where I am thoroughly confused so I am going to attach a bunch of screenshots and hopefully you can walk me through this. My understanding (from office hours) is this is the step that should GET/Download the file and return a blobkey (specific to that file) that I could pass through the flow and eventually use that blobkey to import the file. I may be misunderstanding this, but I have no idea how this works as this step seems to not fetch anything and return whatever is in the request body. So, my thought is I am not understanding the purpose of this step and need some help.

    Screenshots from this step:

    Thank you guys so much and I apologize for the lengthy post, but really need some help understanding how to retrieve/download a file to pass through my flow.

    0
  • Dave Guderian in an ideal world, you wouldn't need to do this, but the "Path to file URLs in HTTP response body" field does not accept an array of values except for string arrays. We have in the backlog to enhance this field to accept JSONPath, but not date on when that would be done.

     

    So in the meantime, there are a couple ways to solve this. 

    1. You could create a connection to Cognito Forms and have it set with 0 authentication since these urls are public. From there, you could have a one-to-many on a lookup step to fetch the blob. IMO, this isn't ideal because it costs you an additional endpoint.
    2. We use integrator.io's mirror api as a tool to accomplish this. The mirror endpoint simply gives you a response back with the exact thing you send to it. So in this case, we will send the attachment link to it, get that same response back, then use the "Path to file URLs in HTTP response body" feature because we've manipulated the data ahead of time to be compatible with this field's limitations.

     

    Going with #2, I would first add a transform step to your export to get a single array of all the attachments. In this case, attachments is mapped to:

    $.EandOAttachment[*],$.W9Attachment[*],$.LicenseAttachment[*]

    Under the field map settings, use the copy object feature for each of the object tabs:

     

    Then on your lookup step, choose "attachments" as the one-to-many path. In the post body, just post this:

    {
     "Attachment": "{{{record.Attachment}}}"
    }

     

    Then for the "Path to file URLs in HTTP response body" use "Attachment". In the below screenshots, you can see we send just the attachment link and after we set the "Path to file URLs in HTTP response body" field, we get the link back, but also get fileMeta and a blobKey. The blobKey is what you need for your google drive step.

     

    Result mapping of lookup:

     

    Google drive step:

    0

Please sign in to leave a comment.

 

Didn't find what you were looking for?

New post