Bulk Add Rows [Feb 26]

:raising_hand_man: Akshay asked

Hello everyone! I’m trying to bulk add rows. I have a column which is a link to another record. Not able to add the connected record in this process. Couldn’t find this in the docs either. I would appreciate any help! Thank you!

:man_bald: dstala replied

Akshay@discord Could you help us with more information? By what method are you attempting bulk-add procedure?

:raising_hand_man: Akshay replied

I’m using the REST API. Tried both the row level post request /api/v1/tableName as well as /api/v1/tableName/bulk. My questions is how does one add a column which is linked to another record via REST API. Thank you!

:raising_hand_man: Akshay replied

When I do add link to another record over UI the frontend calls the API /api/v1/m2mTable1_Table2. However this isn’t documented anywhere. Was trying to figure the best way to go about it.

:person_tipping_hand: o1lab replied

inserting to relational table is not possible with bulk, something we will improve going forward

:raising_hand_man: Akshay replied

o1lab@discord How does one do it one row at a time? When I tried /api/v1/tableName/:parentId/childTableName I keep getting a 404. Am I getting the name of the childTable wrong? How do I know what name to use?

:person_tipping_hand: o1lab replied

the api path will be there in swagger

:raising_hand_man: Akshay replied

o1lab@discord Got it. Thanks so much! Will test this.

:raising_hand_man: Akshay replied

So I just tested the addition of a linked record via the API. It turns out that there are two ways to do it.

via

parent/id/m2mParentChild OR

m2mParentChild

Both accept the same parameter

```

{

“table_1”: “id1”,

“table_2”: “id2”

}

```

However the docs say

```

{

city: “test”

}

```

Should I report this?

:raising_hand_man: Akshay replied

The difficulty here is that to associate any two links I’d have to first run a query to get the relevant id for that entity and then add to the table. Was wondering if it were possible to add via the designated Primary Key. However the API only supports an internal ID generated regardless of what is assigned as the primary key.

Autogenerated from discord


Join NocoDB’s community

DiscordTwitterRedditDocs