Use Knack & EasyCSV Together

How to use EasyCSV to quickly import CSV or Google Sheet data into your Knack app.

How to set up a Knack import page

Step-by-step

  1. Create your import page and set the data destination as any API or Webhook
  2. For the URL field put in your Knack URL with the object id you need: https://api.knack.com/v1/objects/object_X/records (change object_X to make X the number for the object, example obect_9)
  3. If you are creating records from CSV imports, then choose POST request. If you are updating records then choose PUT request.
  4. In your Import Data Flow final destination step click to add custom headers.
  5. Add a custom header with the key: X-Knack-REST-API-KEY
  6. Get the value from the Admin API settings in your knack.com account view. You will navigate to the admin view of your Knack app. Click "Settings" on the left, then "API & Code". Under API, make a new API key. You will use these values for these 2 steps.
  7. Add a custom header with the key: X-Knack-Application-Id
  8. Get the value from the Admin API settings in your knack.com account view.
  9. Back in your import page Import Data Flow final step, click to "Customize JSON to Post". We need to put in the Custom JSON structure that Knack expects for API calls. For different field types you will need to follow special JSON structures described here. Here is an example of what one could look like:
    {
      "field_85": {
        "first": "{{ FIRST_NAME }}",
        "last": "{{ LAST_NAME }}"
      },
      "field_86": {
        "email": "{{ EMAIL }}",
        "label": "{{ EMAIL }}"
      },
      "field_867":"{{ LANGUAGE }}",
      "field_869": {
        "street": "{{ CARRIER_ADDRESS }}",
        "zip": "{{ ZIP }}"
      }
    }

    You will use the syntax field_X to target the right fields. You can get these values from inside your Knack account when editing a field. Watch the video above and then look at the URL in the browser when looking at a Knack field.
  10. Now you shoudl be able to import CSV files and have each row either create new Knack database objects or update them.

Why should I use EasyCSV with Knack?

EasyCSV makes it easy for you to enable you or your users to regulalry import many records into your Knack app using a CSV or Google Sheet. It also give you a nice import page you can use over and over again.

Why do I sometimes get 503 or Timeout errors with Knack?

These errors are random and come from Knacks API. It usually works to simply take the error CSV file from your import results email that you should have received from EasyCSV and re-import that file. Please contact the Knack customer support team and let them know their API is randomly failing requests for your account.