Links¶
Get Links¶
getLinkedRecords
List the linked records of rows. You can get the linked records of multiple rows.
Example
await base.getLinkedRecords('0000', '89o4', [
{'row_id': 'FzNqJxVUT8KrRjewBkPp8Q', 'limit': 2, 'offset': 0},
{'row_id': 'Jmnrkn6TQdyRg1KmOM4zZg', 'limit': 20}
])
// a key-value data structure returned as below
// key: row_id of link table
// value: a list which includes the row info of linked table
{
'FzNqJxVUT8KrRjewBkPp8Q': [
{'row_id': 'LocPgVvsRm6bmnzjFDP9bA', 'display_value': '1'},
{'row_id': 'OA6x7CYoRuyc2pT52Znfmw', 'display_value': '3'},
...
],
'Jmnrkn6TQdyRg1KmOM4zZg': [
{'row_id': 'LocPgVvsRm6bmnzjFDP9bA', 'display_value': '1'},
{'row_id': 'OA6x7CYoRuyc2pT52Znfmw', 'display_value': '3'},
...
]
}
Get Link ID¶
Get Link ID
Example
Add Link¶
addLink
Add links, link other table records
Example
Update Link(s)¶
updateLink
Modify the info of link-type column
Example
batchUpdateLinks
Batch update infos of link-type columns
Example
link_id = "WaW5"
table_name ="Table1"
other_table_name = "Table2"
row_id_list = ["fRLglslWQYSGmkU7o6KyHw","eSQe9OpPQxih8A9zPXdMVA","FseN8ygVTzq1CHDqI4NjjQ"]
other_rows_ids_map = {
"FseN8ygVTzq1CHDqI4NjjQ":["OcCE8aX8T7a4dvJr-qNh3g","JckTyhN0TeS8yvH8D3EN7g"],
"eSQe9OpPQxih8A9zPXdMVA":["cWHbzQiTR8uHHzH_gVSKIg","X56gE7BrRF-i61YlE4oTcw"],
"fRLglslWQYSGmkU7o6KyHw":["MdfUQiWcTL--uMlrGtqqgw","E7Sh3FboSPmfBlDsrj_Fhg","UcZ7w9wDT-uVq4Ohtwgy9w"]
}
await base.batchUpdateLinks(link_id, table_id, other_table_id, row_id_list, other_rows_ids_map)