APIs & Integrations

Kalpana
Member

HubDb API - How to implement where clause and how to update two cells of a table together

I want to perform the below mysql query using HubDb API. . . Please help...

"UPDATE Customers SET ContactName = 'Alfred Schmidt', City= 'Frankfurt' WHERE CustomerID = 1;"

0 Upvotes
3 Replies 3
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

HubDb API - How to implement where clause and how to update two cells of a table together

Hi @kalpana790,

You can get the row with customerId=1 using the 'Get table rows' endpoint & the EQUALS filter. Then, you can use the rowId to update both cells at once by using the 'Update a row' endpoint. HubDB isn't a fully fledged relational database, so it's not possible to make the query you specified above.

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

HubDb API - How to implement where clause and how to update two cells of a table together

Hi @kalpana790,

To update a table row, you need the internal row ID. You might consider pulling the row you're looking for using the 'Get table rows' endpoint (filtering by CustomerID) and then updating that row once you have the row ID.

0 Upvotes
Kalpana
Member

HubDb API - How to implement where clause and how to update two cells of a table together

I just want to update two cells of a row (row has 5 cells) where customerId = 1

I applied for loop to do this but i want another way to do this.

0 Upvotes