APIs & Integrations

AliFawadHassan
Participant

Issue with Retrieving Non-Archived Rows from HubDB Table via API

SOLVE

Hi HubSpot Community,

I am encountering an issue when trying to retrieve rows from a HubDB table, specifically excluding the deleted or archived rows. Although these rows do not appear in the table, I still receive archived rows when accessing the table through the API.

I attempted to use the archived=false filter in my API call as shown below:

https://api.hubapi.com/cms/v3/hubdb/tables/{ID}/rows?archived=false

 

However, I received the following error:

 

 

"error when listing rows for table {TABLE_ID} for portal {PORTAL_ID}: Invalid filter column 'archived'."

It seems that the archived filter is not recognized. Could someone please assist me in correctly filtering out archived rows when making an API request? Any guidance on how to resolve this issue would be greatly appreciated.

Thank you for your support!

Best regards,
Ali

0 Upvotes
1 Accepted solution
Jnix284
Solution
Hall of Famer

Issue with Retrieving Non-Archived Rows from HubDB Table via API

SOLVE

Hi @AliFawadHassan I'm not sure if this applies to the HubDB archived status in the API, but a couple of years ago HubSpot changed the definition of archive vs deleted for APIs - it might be worth trying to exclude deleted instead of archived as a next step.


If my reply answered your question please mark it as a solution to make it easier for others to find.


Jennifer Nixon

View solution in original post

0 Upvotes
2 Replies 2
Jnix284
Solution
Hall of Famer

Issue with Retrieving Non-Archived Rows from HubDB Table via API

SOLVE

Hi @AliFawadHassan I'm not sure if this applies to the HubDB archived status in the API, but a couple of years ago HubSpot changed the definition of archive vs deleted for APIs - it might be worth trying to exclude deleted instead of archived as a next step.


If my reply answered your question please mark it as a solution to make it easier for others to find.


Jennifer Nixon
0 Upvotes
RMaria
Member

Issue with Retrieving Non-Archived Rows from HubDB Table via API

SOLVE

Hi Ali,

 

It looks like you're trying World Animal Foundation to exclude archived rows from your HubDB table using the `archived=false` filter, but encountering an error because the filter is not recognized. Unfortunately, HubDB's API doesn't directly support filtering rows by the `archived` status in the way you've attempted.

 

Here's an alternative approach to filter out archived rows:

 

1. **Retrieve All Rows:** Make an API call to retrieve all rows from the table.

2. **Filter Manually:** After retrieving the rows, manually filter out the archived rows in your application.

 

Here's how you can do it:

 

### Step 1: Retrieve All Rows

Make an API call to retrieve all rows from your HubDB table:

 

```sh

GET https://api.hubapi.com/cms/v3/hubdb/tables/{ID}/rows

```

 

### Step 2: Filter Manually

Once you have the data, you can manually filter out the rows that are archived in your code.

 

Here's an example in Python:

 

```

 

By following these steps, you should be able to filter out archived rows effectively.

 

Best regards,

 

 

0 Upvotes