Nocodb save file from Webhook in Attachment filed

I am uploading file to webhook,
I can parse other data fields from form parameters, but I am unable to save uploaded file to nocodb attachment field.
I am parsing webhook output and using expression:
{{ $(‘Webhook’).item.binary.file0 }}

I get output:
[Object: {“mimeType”: “document/pdf”, “data”: "JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXBlL1hPYmplY3QvU3VidHlwZS9JbWFnZS9XaWR0aCA0MjAvSGVpZ2h0IDQyMC9GaWx0ZXIvRENURGVjb2RlL0NvbG9yU3BhY2UvRGV2aWNlUkdCL0JpdHNQZXJDb21wb25lbnQgOC9MZW5ndGggMTQ0MTg+PnN …

But when executing workflow step nocodb returns error:

NodeOperationError: Item has no binary property called "[object Object]"

Any advice how it can be done?

Hi @Dino_Novak, welcome to the community :tada:

This looks like your binary data lives in a field called file0. In your NocoDB node you’d only need to specify the name of the binary field rather than provide a full expression reading the object itself. Like so:

Hope this makes sense and helps!

On a separate note, when uploading binary data through n8n’s NocoDB node, NocoDB appears to set an unexpected path when using n8n for the upload. This means the attachment is not properly shown in the NocoDB UI (first example is uploaded through the NocoDB UI, second through n8n):

The download path also looks different coming from NocoDB when reading this but actually works when accessing this file:

I’ve added this problem to our engineering backlog for a closer look, so hopefully we can unify these paths going forward as well (edit: The NocoDB team has actually opened a pull request to implement recent API changes and @Jon will look into this problem along with the pull request :raised_hands:)

1 Like

Hello (and sorry for dropping in ramdomly into this thread).

I am also new to n8n and NocoDB and struggle with the same problem: how to attach an image (in my case created via OpenAI) to NocoDB?

Tried almost everything, I can’t get the data output from the OpenAI image node bound to the create row node. I can’t simply add “data” to the node and when using the data binding picker, like the OP did, {{ $('Create Picture').item.binary }} results in an ERROR: Item has no binary property called "[object Object]".

Then I added randomly a Move Binary Data node, connected it to the NocoDB node, this then results into something similar to @MutedJam screen shot: a generic file icon.

So I think I must be doing something fundamentally wrong?

Hi @Heiko_Kanzler, welcome to the community!

The pull request from the NocoDB team mentioned in my previous message hasn’t been reviewed yet I am afraid. Once that’s done your attachments should work as expected again.

Thanks for the warm welcome, @MutedJam

It sounds like that my basic approach wasn’t completely wrong then, it “just” fails on a bug on NocoDB?

I am planning on getting to the PR this week.

3 Likes

More like due to the NocoDB node in n8n needing to adjust to NocoDB’s latest API update, but essentially yes :slight_smile:

That would be awesome!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.