0

How do I get checkbox field values from d/results?

Is there an extra definition needed?

1
  • 1
    Checkbox field returned as true for Yes and false for No Sep 25, 2016 at 14:19

1 Answer 1

1

the checkbox values are returned same as the way other fields are returned, they are Boolean.. you can try below code

  var item = ''; 
  return $.ajax({
        url: _spPageContextInfo.siteAbsoluteUrl + "/_api/web/lists/getbytitle('"+listName+"')/items?$select=IsClosed",
        type: "GET",
        data: JSON.stringify(item),
        headers: {
          "Accept": "application/json;odata=verbose"
        }
      })
      .done(function(data) {
        for(var i = 0;i<data.d.results.length;i++)
        {
            Console.log("IsClosed : "+data.d.results[i].IsClosed)
        }
      })
     .fail(function() {
        alert("error");
      });

Hope this will help you.. Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.