Hi
I want to display distinct count of values in SharePoint list column.
How to achieve this.
Thanks
Siva
Technology Tips and News
Hi
I want to display distinct count of values in SharePoint list column.
How to achieve this.
Thanks
Siva
hi
below link will help you out.
This is not complex.
Use case: You have data in a list which needs to be retrieved using JavaScript for those records where Title is unique. <SP URL> is the URL for your SharePoint and <List Name> is the name of your list.
$.ajax({ url: <SP URL> + "/_api/web/lists/getbytitle('" + <List Name> + "')/items", method: "GET", headers: { "Accept": "application/json; odata=verbose" }, success: function (data) { var result = [], items = data.d; $.each(items, function(index, item) { if ($.inArray(item[propertyName], result)==-1) { result.push(item[propertyName]); } }); //work with your results now. This is just a sample alert(result.length); }, error: function (data) { alert(data); } });