# How to select particular columns on data table for API actions?

**URL:** <https://forums.losant.com/t/how-to-select-particular-columns-on-data-table-for-api-actions/5121>\
**Category:** Help\
**Tags:** rest-api\
**Created:** [June 21, 2023, 10:43am UTC](https://forums.losant.com/t/how-to-select-particular-columns-on-data-table-for-api-actions/5121 "2023-06-21T10:43:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Projjal\_Seal](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/projjal_seal/32/4620_2.png) [@Projjal\_Seal](https://forums.losant.com/u/Projjal_Seal)\
**Post date:** [June 21, 2023, 10:43am UTC](https://forums.losant.com/t/how-to-select-particular-columns-on-data-table-for-api-actions/5121/1 "2023-06-21T10:43:36Z")

</div>

We have a new use case , in which we will need to filter on a particular column from a data table.

Data table example-

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/f/fba07922e0a31543a182e3274e246527cd31df20.png)  
{  
“query”: {},  
“limit”: 1000,  
“offset”: 0,  
“sortDirection”: “asc”,  
“sortColumn”: “id”,  
“items”: [  
{  
“HUB”: “EMEA1”,  
“Capacity”: 54,  
“TotalOccupancy”: 20,  
“Space”: “PLKC0100”,  
“Building”: “PLKC01”,  
“Location”: “PLKC”,  
“updatedAt”: “2023-06-21T10:16:48.411Z”,  
“createdAt”: “2023-06-19T07:11:14.163Z”,  
“id”: “648fff920984ee7c845838af”  
},  
{  
“HUB”: “EMEA1”,  
“Capacity”: 163,  
“TotalOccupancy”: 34,  
“Space”: “PLKC0101”,  
“Building”: “PLKC01”,  
“Location”: “PLKC”,  
“updatedAt”: “2023-06-21T10:16:48.861Z”,  
“createdAt”: “2023-06-19T07:11:14.672Z”,  
“id”: “648fff920984ee7c845838b1”  
},  
{  
“HUB”: “EMEA1”,  
“Capacity”: 163,  
“TotalOccupancy”: 62,  
“Space”: “PLKC0102”,  
“Building”: “PLKC01”,  
“Location”: “PLKC”,  
“updatedAt”: “2023-06-21T10:16:49.301Z”,  
“createdAt”: “2023-06-19T07:11:15.285Z”,  
“id”: “648fff930984ee7c845838b6”  
},  
{  
“HUB”: “EMEA1”,  
“Capacity”: 163,  
“TotalOccupancy”: 44,  
“Space”: “PLKC0103”,  
“Building”: “PLKC01”,  
“Location”: “PLKC”,  
“updatedAt”: “2023-06-21T10:16:49.743Z”,  
“createdAt”: “2023-06-19T07:11:15.964Z”,  
“id”: “648fff930984ee7c845838b9”  
},  
{  
“HUB”: “EMEA1”,  
“Capacity”: 103,  
“TotalOccupancy”: 73,  
“Space”: “PLKC0104”,  
“Building”: “PLKC01”,  
“Location”: “PLKC”,  
“updatedAt”: “2023-06-21T10:16:50.031Z”,  
“createdAt”: “2023-06-19T07:11:16.615Z”,  
“id”: “648fff940984ee7c845838bb”  
}  
],  
“count”: 5,  
“totalCount”: 5,  
“applicationId”: “5f05879d599cfa00069dc8be”,  
“dataTableId”: “648ffb5346cd3e889a4c6187”  
}

Here I want only to select one row , filtering on space , eg I want to get only one row whose space is PLKC0100.

Are there any APIs for this ?

I used below APIs , but received the entire set of data .

Get-[https://api.losant.com/applications/5f05879d599cfa00069dc8be/data-tables/648ffb5346cd3e889a4c6187/rows](https://api.losant.com/applications/5f05879d599cfa00069dc8be/data-tables/648ffb5346cd3e889a4c6187/rows)

[https://api.losant.com/applications/5f05879d599cfa00069dc8be/data-tables/648ffb5346cd3e889a4c6187/rows?items.Space=PLKC0100](https://api.losant.com/applications/5f05879d599cfa00069dc8be/data-tables/648ffb5346cd3e889a4c6187/rows?items.Space=PLKC0100)

Also query API returned all the rows instead of 1.

[https://api.losant.com/applications/5f05879d599cfa00069dc8be/data-tables/648ffb5346cd3e889a4c6187/rows/query?items.Space=PLKC0100](https://api.losant.com/applications/5f05879d599cfa00069dc8be/data-tables/648ffb5346cd3e889a4c6187/rows/query?items.Space=PLKC0100)

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [June 21, 2023, 12:28pm UTC](https://forums.losant.com/t/how-to-select-particular-columns-on-data-table-for-api-actions/5121/2 "2023-06-21T12:28:07Z")

</div>

[Data Table Rows: Query](https://docs.losant.com/rest-api/data-table-rows/#query) is the endpoint you want. Per the documentation for that endpoint …

- Include the query you want to execute in the body of the request - so in your case, a body of `{"Space": "PLKC0100" }`.
- `limit` is a query param, so that needs to be appended to the request URL: `?limit=1`

The Losant API is fully documented with URLs, accepted parameters, schemas for request bodies, and example requests at [docs.losant.com](http://docs.losant.com). I recommend starting there when interacting with our API directly.

---

<div class="post-metadata">

**Author:** ![Projjal\_Seal](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/projjal_seal/32/4620_2.png) [@Projjal\_Seal](https://forums.losant.com/u/Projjal_Seal)\
**Post date:** [June 28, 2023, 9:20am UTC](https://forums.losant.com/t/how-to-select-particular-columns-on-data-table-for-api-actions/5121/3 "2023-06-28T09:20:59Z")

</div>

Hi Dylan,

Thanks a lot.  
This works for us.
