Linked Records via Node-Red

Hey Tulip Community!

I am currently trying to link records that are generated from a Node-Red flow using the node-red-tulip-api node and haven’t been able to find what is wrong with my request format. When I send the following msg.body to the tulip-table node I receive the following error:

Field Data Sources:

MY_TABLE_#_link_left_column & MY_TABLE_#_link_right_column (from each table where link exists):

The Request format:

This function node annotated above is connected between the Create Record tulip node (working :slight_smile:) and the link node.

I get a 400 (malformed request) response when the Link Record node runs. Based on my investigation thus far, it appears the path variable is not including the “msg.tableLinkId“ in the path of the response coming out of the link node.

Here’s the output in response → req → path

PUT /api/v3/tableLinks//link HTTP/1.1
content-type: application/json
Host: my_company.tulip.co
Authorization: (removed because API key lol)
Connection: keep-alive
Transfer-Encoding: chunked

Other general questions I have about Link Records:

My plan is to use linked records to display the results of a few different tables (currently 3) into a single table view for operators to view. Should I continue with this approach or try to determine another solution?

If anyone has implemented a similar solution or knows how I can resolve this, any help would be greatly appreciated :slight_smile: .

Not sure if this is what its about but I recognized two things:

msg.body = {
"leftRecord": "TABLE_1_ID_link_left_column", 
"rightRecord": "TABLE_2_ID_link_right_column",
};

there is a comma , after the last entry before };
This implies there is more key-value pairs following…

msg.tableLinkId = "id"; 

Is this only for testing? Is there a real record with the Id "id" ?
Or did you mean to put a variable id ?

Hey Thorsten,

I’m not sure if the comma after the “TABLE_2_ID_link_right_column” could cause this issue but I did remove it just to be safe :slight_smile: .

The “id“ used in (msg.tableLinkId = “id”;) was used for testing only. In the real payload I am setting that in the msg.tableLinkId to be the epoch datetime of the record generation. When I check the debug after the link node I can see that the msg.tableLinkId does match the upstream setup.

Example value from debug node:

msg.tableLinkId = “1772810940” 

I’m not 100% sure from the API documentation if the tableLinkId field is meant to be:

1.) the ID of the table that contains the linked field or

2.) the table UID.

3.) the UID of the linked field column from the “left” table.

Currently I have this as the ID of the table the table that contains the linked field. (number 1 above).

Here’s a quick list of resources I’ve used so far to troubleshoot:

I appreciate your response :slight_smile: . If there is any other details I can provide let me know.

Thanks!

When you look close, the aK7mP3qRb9TzY1cHd_link_right_column and aK7mP3qRb9TzY1cHd_link_left_column have the same random string.

This isolated random string is the link ID:
aK7mP3qRb9TzY1cHd

You can find this out by using the Table api:
/tables/{tableId}
Look up a Tulip Table

...
"columns":[
   {
   "name": "id"
   "label": "ID"
   "description": ""
   "dataType":{
       "type": "string"  
       }
   "hidden": false
   "unique": true
   }
   {
   "name": "aK7mP3qRb9TzY1cHd_link_right_column"
   "label": "Picture_ID" 
   "description": ""
   "dataType":{
       "columnOrientation": "right"
       "tableLinkID": "aK7mP3qRb9TzY1cHd"       <-------------------here
       "type": "tableLink"
       }
   "hidden":boolfalse
   "unique":boolfalse
   }
...