Send table name in a webhook

Hello!
I’m new at baserow and not very experienced in databases, webhooks, etc.
Using a webhook, I’m trying to integrate baserow in n8n to do simple tasks as notify users by e-mail with changes that occurs within databases/tables, import e-mails to baserow and a little bit more.

I have a simple question (maybe answered previously but I searched and haven’t found anything related) which is: When sending information using a webhook that some row has been created/modified or deleted, is it possible to send the table/database name too instead of only the corresponding ID, without workarounds?

I want to inform the receiver of the e-mail which database/table/row has been created/modify/deleted but in n8n, without manually correspond IDs with a name (which can change or new tables created) and be specific in the body of the mail. This makes sense?

Thank you very much in advance!

Hey @lgeraldes ,

That is not possible with the webhook itself I think.

You can indeed get the name of the table or database via the provided ID and sending a request to the Baserow API to get additional data regarding the table/datbase.

We do have the option to use field names or ids so maybe we can add another checkbox that will turn the table_id into the table name.

Is it not possible to send an additional request to Baserow via n8n to get the name? (I am an n8n noob so I wouldn’t know :smiley: )

1 Like

I was just informed we have an n8n expert amongst us @joffcom.

Maybe you can help us out here? :slight_smile:

Hello!
Thank you beforehand for your quick answer.
As I understood correctly, you suggest using the Baserow API to obtain the table/database name by ID.
In fact, in the Baserow node in n8n, I can see the table names after login with my credentials. I’ll try to implement some HTTP node there to try call a request so I can obtain the table name by its ID (I’ve tried already once but unsuccessfully, I’ll keep trying).

Let’s wait too for our friend that you’ve tagged so maybe there’s an easier way.

Thank you! :grin:

Hey @Alex & @lgeraldes,

Not only am I an n8n expert I am one of the Community Engineers :joy:

Looking at the webhooks from Baserow they don’t currently use the name but because Baserow webhooks are per table there are some alternative options.

  1. In your webhook add a custom header say table-name then set that value to your table name, Now in the n8n webhook under Headers you will see table-name and the value will be what you send.

Baserow

n8n

  1. Use a different webhook path for each webhook, You can have multiple webhook triggers in a workflow so you could have one workflow for each database then have the path set to match the table name.

Normally I would suggest using an API call to get the value but I can’t see an API call that would get the name from the ID of a table, In n8n we first call /api/applications/ to get all the databases then we call /api/database/tables/database/${databaseId} to get the tables so I guess that process could be copied but to be honest it is likely to be more work than option 1 but if needed I can work on a quick example over the weekend.

Hello!

I’ve thought of that option 1. could work but tried and the headers haven’t appeared in n8n header, idk why. If I need to create a webhook for each table inside each database, then I think it’s a good option. The only inconvenience that I see is if a table gets renamed.

Regarding option 2. if I understood correctly, you suggest using different webhook nodes to each table and that way, each time one is used, I can call it by the table name. I prefer the method one instead of this :stuck_out_tongue:

That last part I didn’t quite understand what you are saying. How or to where I can copy that process? Inside n8n in an HTTP Request node?
Right now I’ve been trying to experiment with Baserow API, checking requests with Postman but can’t even get past the Authentication part (“detail”: “Authentication credentials were not provided.”), despite knowing that I’m probably doing the things correctly.
Anyway, I’ll try to get the work done using option 1. right now.

Thank you very much!

Just to update, adding the headers in the webhook, now are showing. Maybe it was because I’ve called them “database_name” and “table_name” with ‘_’ instead of ‘-’ ?

Thank you!

1 Like

You probably forgot to add the word JWT infront of your token.

The pattern is JWT XXXXXX where XXXXXX is your token.

Perfect, I noticed the same thing when I was testing it before sending the reply :slight_smile:

The last part would have been something to make using HTTP Request nodes but I feel like the first option is probably the best one. At some point I want to make a Baserow Trigger node that will make the webhook automatically so I will keep this in mind for that.

Hey @lgeraldes,

If you are using a self hosted version of n8n I have just created a Baserow Trigger node as a community node so you can install it and create your webhooks in n8n.

1 Like

Hello!
That’s so awesome! That looks really good and simplifies the process.
Right now I’m only using the Windows Desktop version because we’re running tests to this integration. In a few days, I’m going to self-host it to get it in production, then I’ll try it.

Thank you very much!

1 Like

@joffcom sorry to bother one more time, I’d like to ask just one more thing regarding this integration:
I’m trying to put a pdf file coming from e-mail attachment in a baserow cell, but I’m getting an error.
Probably that’s not the correct way to implement this, but I don’t understand how I need to pass it:


Thank you!

Hey @lgeraldes,

Rather than using the {{ $binary }} expression try just putting in the item name in this case attachment_0 I have not tried to send binary data to Baserow before but we normally don’t support expressions for sending binary data so this would be the best chance of it working.

Hello,
Doesn’t work neither, happens the same error.
I’m gonna probably try to use the HTTP node and submit the file via baserow API.

1 Like

I will take a look when I get near a laptop next and see what is going on. Could be that we need to add something.

Thank you! I’m trying with HTTP Request node but not getting very lucky neither, “Bad request” too :sweat_smile: