APIs & Integrations

shivammishra
Participant

Update foreign ID cell of hubDB using API

SOLVE

I am not sure what would be the request format to update a foreign ID cell of hubDB table when I am using update a specific cell API.

 

Looking forward to a solution!! Please help.

0 Upvotes
1 Accepted solution
miljkovicmisa
Solution
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

Update foreign ID cell of hubDB using API

SOLVE

Ow snap! I missed the part where you actually update a single cell, as the cell is already defined in the url the json body should look like this:

{"value" : [
    {
        "id": <ID OF THE ROW OF FOREIGN TABLE>,
        "type": "foreignid"
    }
  ]
}

 

If my answer was helpful please mark it as a solution.

View solution in original post

6 Replies 6
skylightipv
Contributor

Update foreign ID cell of hubDB using API

SOLVE

 be interested if you came across the same issue as I did when inserting a foreign id via API

 

https://community.hubspot.com/t5/APIs-Integrations/HUBDB-foreign-ID-insertion-via-API-doesn-t-work/m...

0 Upvotes
miljkovicmisa
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

Update foreign ID cell of hubDB using API

SOLVE

Hello @shivammishra , 👋 @dennisedson , the call with the values for the foreign id should look like the following:

 

{"<INDEX OF COLUMN>": [
  {
    "id": <ID OF ROW OF THE FOREIGN TABLE>,
    "type": "foreignid"
  }
]}

 

 

So the value of the foreign id is an object (array of arrays) because it is a special type of multiselect as I see it. Inside it is the id of the row of the foreign table you selected in your column.
If you need any further help don't hesitate to write here.

If my answer was helpful please mark it as a solution.

 

shivammishra
Participant

Update foreign ID cell of hubDB using API

SOLVE

Thanks for the prompt response.

Now it does not give me error anymore but it does not show the column getting updated in HubDB as well.

Success response on put request is : 

{
"value": null
}

I am using this API call : https://legacydocs.hubspot.com/docs/methods/hubdb/v2/update_cell

which is to update a specific column value and not the entire row. Does this format is applicable on this API as well?

Also I am assuming publishing the HubDB table is not required to see the value in HubDB after above API call.

0 Upvotes
miljkovicmisa
Solution
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

Update foreign ID cell of hubDB using API

SOLVE

Ow snap! I missed the part where you actually update a single cell, as the cell is already defined in the url the json body should look like this:

{"value" : [
    {
        "id": <ID OF THE ROW OF FOREIGN TABLE>,
        "type": "foreignid"
    }
  ]
}

 

If my answer was helpful please mark it as a solution.

shivammishra
Participant

Update foreign ID cell of hubDB using API

SOLVE

This works!! Thanks much.

dennisedson
HubSpot Product Team
HubSpot Product Team

Update foreign ID cell of hubDB using API

SOLVE

@miljkovicmisa 👋

Have you messed around with this before?

0 Upvotes