How do I get unique values in REST API?

How do I get unique values in REST API?

You Can do group by to get the distinct value. You cannot keep directly group by option in REST API URL so you can keep CAML query in REST API, In CAML query you can use GROUP By option.

How can I get distinct values from SharePoint list using CAML Query?

Get SharePoint list item by List Unique Field using CAML Query

  1. // Function to get value.
  2. public SPListItem GetRKListItemByRefNo(SPWeb objSPWeb, string refNo)
  3. {
  4. SPList objSPInvoiceList = objSPWeb.Lists[“RKList”];
  5. string camlQuery = string.Empty;
  6. if (!
  7. {

How do I find the distinct value?

Filter for unique values or remove duplicate values

  1. To filter for unique values, click Data > Sort & Filter > Advanced.
  2. To remove duplicate values, click Data > Data Tools > Remove Duplicates.
  3. To highlight unique or duplicate values, use the Conditional Formatting command in the Style group on the Home tab.

What is distinct function?

Description. The Distinct function evaluates a formula across each record of a table and returns a one-column table of the results with duplicate values removed. When used with a data source, this function can’t be delegated. Only the first portion of the data source will be retrieved and then the function applied.

How to get distinct values from SharePoint REST API?

You Can do group by to get the distinct value. You cannot keep directly group by option in REST API URL so you can keep CAML query in REST API, In CAML query you can use GROUP By option. You can see this post for REST API with CAML http://www.c-sharpcorner.com/blogs/sharepoint-rest-api-caml-query

How to group distinct values from a list using OData REST API?

Hi I have a list with two fields “Regions” & “Countries” I am using a rest api to retrieve the list of just regions like so: http:mysitename/_api/web/lists/getByTitle (‘TaxTool’)/items?$select=Region In the results there are lots of duplicates and I was wondering how to return unique values.

How to query distinct data of SharePoint list?

Well Yes, you should be able to query the data through simple SQL – select Distinct… I have been using the same concept for Users web service. However, it is just a lead for you. Thanks for contributing an answer to Stack Overflow!

Is there a rest filter for distinct values?

There isn’t a REST filter that I know of that will handle getting distinct or unique values. You’ll need to do that in your success callback. Typically I do this by creating an array and looping through the results.