After reviewing my results, I realized one of the sharepoint columns only returns one value. How do I get it to return each value from my Role Column?
It should look like this:
Title: FDA Program
Roles: Project Manager, Business Analyst
Instead, it only returns this:
Title: FDA Program
Roles: Project Manager
<script type="text/javascript">
$.ajax({
url: "https://gumdropsgc.sharepoint.com/sites/Training/_api/web/lists/getbytitle('Modules')/items?$filter=File_x0020_Name Eq 'FDAAgents'&$top=1",
type: "GET",
headers: {"Accept": "application/json;odata=verbose"},
cache:false,
success: function(data){
console.log(data);
var html = "<table border='0'>";
$(data.d.results).each(function(){
html = html + "<tr><td>" + this.Title + "</td></tr>" +
"<tr><td><h2>" + "Roles :" + " " + this.Roles + "</h2></td></tr>";
});
html += "</table>";
$("#listResult").html(html)
}
});
</script>
<div id="listResult"></div>
Roles
is it a multi select field?Roles
exactly? A choice field that allows multiple selections, a taxonomy field that allows multiple selections, a person field that allows multiple selections? A lookup that allows multiple choices? (if lookup include some information about the lookup target content type) In the simple case of a choice field you should be getting an array of strings inside of aresults
JSON container, but the fact that you're getting one value leads me to believe this isn't the case.