Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Get unique values from sharepoint list in drop down

$
0
0

             function getEmpList()
            {
                $.ajax({
                    url: siteurl + "/_api/web/lists/getbytitle('TestEmpInfo')/items?$select=Id,EmpName",
                    method: "GET",
                    headers: { "Accept": "application/json; odata=verbose" },
                    success: function (data) {
                        empList.push(data.d.results);
                        console.log(empList);
                        var uniqueEmpList = GetUnique(empList);
                        console.log(uniqueEmpList);
                        for(i=0;i<data.d.results.length;i++)
                        {
                            $('#totalEmpList').append($("<option/>").val(uniqueEmpList[i].Id).text(uniqueEmpList[i].EmpName)); 
                        }     

                    },
                    error: function (data) {
                        alert("Error: "+ data);
                    }                
                });
            }

Please help me with this
I have to get uniques values of shrepoint list to a dropdown

Thanks in advance 

                       

Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>