Method Community

 

how do i retrieves distinct (unique) records?

Last post 06-26-2024 1:16 PM by Method_Inderdeep. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-24-2024 12:30 PM

    how do i retrieves distinct (unique) records?

    "I'm using Azure Data Factory to fetch records. How do I ensure each request retrieves distinct (unique) records? For example, if I have 201 records in SalesOrderLine and want to get all data using an API call without duplicating records each time, how can I ensure it returns the latest data with each request?"

    let's say:  i have 201 record and i have hit endpoint i will get 100 record but when i request 2nd time it should provide me next 100 unique record . please provide me some example or  url request  sample.

    here is api URL  request  : 

    @{concat('https://rest.method.me/api/v1/tables/SalesOrderLine?filter=SORecordIDTxnDate le ''''2024-05-30T18:00:00''''&orderby=SORecordIDTxnDate desc&$top=1')
    }

  • 06-26-2024 1:16 PM In reply to

    Re: how do i retrieves distinct (unique) records?

    Hi athakur,

    When you run the following query on your account, the response of that query has the next link generated with next 100 records in the list. For example if you run the below query:

    https://rest.methodbuilder.com/api/v1/tables/SalesOrderLine?skip=0&top=100&filter=SORecordIDTxnDate le '2024-05-30T18:00:00'&orderby=SORecordIDTxnDate desc

    Here is the result:

    All you have to do now is use the NextLink highlighted in the screenshot and use that to skip the first 100 records and grab the next 100 records. 

    Hope this helps!

    Cheers,

    Inder

Page 1 of 1 (2 items)