Bulk `Link` creation [Jun 07]

:raising_hand_man: WM31 asked

Hi all! This platform is promising and I am trying to migrate our multi-excel task worksheet to Nocodb. The worksheets have a key row that build the relation. I found that the API can’t do mass update of the one to one mapping between uploaded worksheets with the key, am I doing it wrong with the API or there are other under the hood method I can try?

:man_bald: dstala replied

<@535455522435104798>, API to manage links currently is one to one. We will consider this as an enhancement request.

:raising_hand_man: WM31 replied

You mean there is a way to edit a one row to one row link between table through API?

:raising_hand_man: WM31 replied

I am trying to build a master key table to enable that I can do nesting lookup between tables

:man_bald: dstala replied

here in this example, I am creating linear links (one-to-one) between two tables using API. Note that I have used ‘has-many’ as link relation type.

1.js

:raising_hand_man: WM31 replied

I noticed that the example is done on table creation, is there a way to do so after imports? Like do so through a REST client?

:raising_hand_man: WM31 replied

MY current setting is one to many, though I use them for one to one

:man_bald: dstala replied

NocoDB API Documentation

:man_bald: dstala replied

You will need {rowId} & {referenceRowId} :: primary key of two tables that you wish to link.

:raising_hand_man: WM31 replied

This page can’t help as it don’t have the Json sample. can you use your JS sample to demo the Json content to me?

:man_technologist: pranavxc replied

Above api doesn’t need any JSON payload instead you have to pass both row id in url path param

:man_technologist: pranavxc replied

http://localhost:8080/api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId}/{relationType}/{columnName}/{refRowId}

:raising_hand_man: WM31 replied

O ok

:raising_hand_man: WM31 replied

What is the key for{relation type}?

:raising_hand_man: WM31 replied

And both row ID means the system internal row ID? Can those be exported as CSV?

:man_technologist: pranavxc replied

based on the relation created … it can be mm (Many to many) , hm (has many) or bt (belongs to)

:raising_hand_man: WM31 replied

Ok noted on the key

:man_technologist: pranavxc replied

even if you passed wrong relation type it will work

:raising_hand_man: WM31 replied

This is a patch or post?

:man_technologist: pranavxc replied

You can enable system fields under fields dropdown and the id you can enable