# SharePoint list data using Graph API: Filter on any column doesn't work

**URL:** <https://forum.inductiveautomation.com/t/sharepoint-list-data-using-graph-api-filter-on-any-column-doesnt-work/76767>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [July 24, 2023, 8:14am UTC](https://forum.inductiveautomation.com/t/sharepoint-list-data-using-graph-api-filter-on-any-column-doesnt-work/76767 "2023-07-24T08:14:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul\_Bhakte1](https://avatars.discourse-cdn.com/v4/letter/r/c89c15/32.png) [@Rahul\_Bhakte1](https://forum.inductiveautomation.com/u/Rahul_Bhakte1)\
**Post date:** [July 24, 2023, 8:14am UTC](https://forum.inductiveautomation.com/t/sharepoint-list-data-using-graph-api-filter-on-any-column-doesnt-work/76767/1 "2023-07-24T08:14:48Z")

</div>

I am trying to fetch data from SharePoint URL for the first time. I have managed to get all the list data from sharePoint URL but when I try to apply filter on any column, I didn't get any expected data.  
Can you please help in this case?  
Here is the code part of code I am working on.

```auto
header = {'accept':'application/json','Authorization':'Bearer ' + LatestToken} 

#Below URL works. All data from sharePoint list fetched by passing Site ID and List ID.
rawResponse = client.get(https://graph.microsoft.com/v1.0/sites/+sharepointGUID +/lists/%7B + ListGUID + %7D/items?$expand=fields&$top=100,headers=header)
return rawResponse.json

#Here I added filter with encoded URL but it fetched only 200 records with any filter when there are about 8000 records with filter on sharepoint.
rawResponse = client.get(https://graph.microsoft.com/v1.0/sites/+sharepointGUID +/lists/%7B + ListGUID + %7D/items?$expand=fields&%24filter%3DstartsWith%28fields%2F + FilterField + %2C + FilterValue + %29,headers=header)
return rawResponse.json

```

I am not sure what I am missing here.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [July 24, 2023, 8:37am UTC](https://forum.inductiveautomation.com/t/sharepoint-list-data-using-graph-api-filter-on-any-column-doesnt-work/76767/2 "2023-07-24T08:37:20Z")

</div>

The startsWith only filters if filtervalue is a text, could it be you are trying to filter a number?

a default page size? its probably something you should ask on their forum instead of here.

simulate the request in postman or something and see what you get  
(see if you get a `@odata.nextLink` in the reply, which would mean paging )

---

<div class="post-metadata">

**Author:** ![Rahul\_Bhakte1](https://avatars.discourse-cdn.com/v4/letter/r/c89c15/32.png) [@Rahul\_Bhakte1](https://forum.inductiveautomation.com/u/Rahul_Bhakte1)\
**Post date:** [July 24, 2023, 8:52am UTC](https://forum.inductiveautomation.com/t/sharepoint-list-data-using-graph-api-filter-on-any-column-doesnt-work/76767/3 "2023-07-24T08:52:05Z")

</div>

Hi @victordcq  
Thank you for replying.  
I am actually trying to filter a string not a number. As you suggested, I tried this in postman but getting same result. I think you are right. I should ask this query on sharePoint forum.

Thank you once again.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 24, 2023, 3:47pm UTC](https://forum.inductiveautomation.com/t/sharepoint-list-data-using-graph-api-filter-on-any-column-doesnt-work/76767/4 "2023-07-24T15:47:41Z")

</div>

As an aside, you should really consider using the `params` argument to `get()` - it will automatically URL encode a key: value dictionary, so you don't need to worry about concatenation, URL escaping, etc.

---

<div class="post-metadata">

**Author:** ![Rahul\_Bhakte1](https://avatars.discourse-cdn.com/v4/letter/r/c89c15/32.png) [@Rahul\_Bhakte1](https://forum.inductiveautomation.com/u/Rahul_Bhakte1)\
**Post date:** [July 26, 2023, 12:05pm UTC](https://forum.inductiveautomation.com/t/sharepoint-list-data-using-graph-api-filter-on-any-column-doesnt-work/76767/5 "2023-07-26T12:05:10Z")

</div>

Thank you for a thought @paul-griffith.  
I will try this way.
