Forum Discussion

María José Pedreira's avatar
María José Pedreira
Brass Contributor
Jun 28, 2017

REST query Sharepoint 2013

Hello,

I need to retrieve items with Title repeated twice or more. Can we do it with a REST query?

Next url give me all the items, but I need to filter items with occurence 1
 

https://mysite.com/_api/web/lists/GetByTitle('mylist')/items?$select=Title&$filter=year%20eq%202017&sortlist=%27Title:descending%27 


Thank you!

  • Pieter Veenstra's avatar
    Pieter Veenstra
    Jun 28, 2017

    The 100 items is a way to protect your system. you can overrise this by using $top like this:

    _api/web/lists/getByTitle(
      'Books')/items?$select=Title&$filter=Author eq 'Mark Twain'&$top=2
    • María José Pedreira's avatar
      María José Pedreira
      Brass Contributor

      Hi Pieter Veenstra,

      My result should retrieve several hundred of items. But the fact is I receive only the first 100 items. Perhaps this behaviour is because my default view shows 100 items. Does this behaviour have sense? Or perhaps I'm understanding something wrong....

      My goal is detect repeated items, so I thought about retrieve only the items repeated 1 or more time. But I have to obtain them just after my ajax call, not working with them in an array, because my array populates only with 100 items by call

      • Pieter Veenstra's avatar
        Pieter Veenstra
        MVP

        The 100 items is a way to protect your system. you can overrise this by using $top like this:

        _api/web/lists/getByTitle(
          'Books')/items?$select=Title&$filter=Author eq 'Mark Twain'&$top=2

Resources