How to upload an image from N8N to baserow?

I’m trying to send a mime type file from N8N to baserow, but I can’t, can someone help me?

{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        180,
        40
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "image",
              "value": "base64"
            }
          ]
        },
        "options": {}
      },
      "name": "Set",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        400,
        40
      ]
    },
    {
      "parameters": {
        "mode": "jsonToBinary",
        "convertAllData": false,
        "sourceKey": "image",
        "options": {
          "dataIsBase64": true,
          "mimeType": "image/png"
        }
      },
      "name": "Move Binary Data3",
      "type": "n8n-nodes-base.moveBinaryData",
      "typeVersion": 1,
      "position": [
        600,
        40
      ]
    },
    {
      "parameters": {
        "operation": "update",
        "databaseId": 28161,
        "rowId": "6",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldValue": "={{$node[\"Move Binary Data3\"].binary.data.mimeType}}"
            }
          ]
        }
      },
      "name": "Baserow",
      "type": "n8n-nodes-base.baserow",
      "typeVersion": 1,
      "position": [
        820,
        40
      ],
      "credentials": {
        "baserowApi": {
          "id": "18",
          "name": "Baserow admdiegolima"
        }
      }
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Set",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set": {
      "main": [
        [
          {
            "node": "Move Binary Data3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Move Binary Data3": {
      "main": [
        [
          {
            "node": "Baserow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

can you do it by the native node or would you have to use http request?

Hey @admdiegolima, sorry for the late answer.

Baserow API doesn’t allow to upload a file and create/update a row at the same time. So if you want to add a file to a row, you have to upload it first with a HTTP POST using a basic n8n request node to the /api/user-files/upload-file/endpoint. As soon as the file is created, with the response content, you can reference it during the row creation.

Try to upload a file with the UI to see how it’s working. You’ll see something like that:

image

The first POST is the file being sent to the server then the response content is used to create a PATCH query to update the row with the new file. You also can also use an another POST to create a row instead of updating one. Alternatively if a file exists already and is referenced elsewhere you can use the same file informations for your row.

Does it help?

i have done step one of uploading the files to the user-files API.

Now can i reference that file and use it inside an expression field value of a normal Baserow create node ?

Yes you should be able to use it with the normal baserow create node. Use the name of the returned file.