Create a new Row and cell Link To

Hello community
My first question is here

I am creating a new row in the NocoD referral table using the API with adding the user id from the related table - but I can’t add the array with the user id

I’ll stay through built-in and through http

My Referrals table with associated Column client_id

HTTP Request

##swagger rest api

Please help me understand what I’m doing wrong :pray::pray::pray:

Hi @404dragon, welcome to the community :tada:

I’ve set up a both n8n and NocoDB using the respective latest Docker images. NocoDB’s API documentation it seems this is the required request to create such a nested relation: POST http://localhost:8080/api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId}/{relationType}/{columnName}/{refRowId}

In n8n this could be done using the HTTP Request node like so after creating a row:

In this example:

  • p_dtowbji1mqx8vq is my project
  • md_9nkcmpg6gc4ls6 is my table
  • 1 is the row in the table I am updating
  • mm is the relationship type (I reckon it stands for many-to-many, but NocoDB’s API description above doesn’t explain this in more detail)
  • client_id is the column
  • 3 is the row in the table I have referenced

This seems to work as expected. My NocoDB table before running the workflow:

After running the workflow:

Updated table:

Corresponding table:

Hope this helps!

1 Like

great, thanks for the method.

I will share my version, which I use now

After creating a relationship between tables ( 1 - on the Screenshot) A column with foreignkey is automatically created ( 2 - on the Screenshot)

Here in it you can write down the ID of the drains from the User table and this solved my problem

1 Like

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