This project has moved and is read-only. For the latest updates, please go here.

GetListItems - retrieve checkbox value

Aug 23, 2012 at 11:24 PM


I'm struggling with retrieving a value from a list column checkbox.

The default value is set to No, so when I retrieve it I would expect No || 0 || something other than undefined.

bolStrategicRoadMap = $(this).attr('ows_Strategic_x0020_Roadmap');


Aug 24, 2012 at 3:43 PM

Sometimes you get this when the column does not have any data in it.  An alternative method (which is quite common in my code and others) would be to simply check for "undefined".


Aug 24, 2012 at 9:31 PM

I have run into this same situation.  Even though I set a field up as a Yes/No data type with a default of "No", it is returned as undefined (even though it looks like a "No" on the EditForm.aspx).  If I cycle the value at least once after the record is created, I get a firm true or false return from it.  So, knowing that, i agree with Matt that you need to inspect for an "undefined" value as well, which basically means you meant for it to be false on a new record but the value was never initialized as such.

I've noticed if I put a list in datasheet view, I can ever so slightly tell which checkboxes have never been touched (and had a default value of "No" to begin with).  They appear to have a slightly disabled look about them as compared to checkboxes that are a firm false value.

Aug 24, 2012 at 10:04 PM

+1 to gkoliver for the datasheet preview trick. I use that all the time but forgot to mention that. :)

I've seen the "disabled" look for columns created after the list has items in it. Give it a try and see for yourself.



Aug 25, 2012 at 3:45 PM

Thanks all!

This is the same conclusion i came to after i posted. Got to hand it to MS for making a SharePoint Admin/Developer's life interesting.

I did in fact add code to inspect for undefined and am goint to take a look at the cycling of newly created list items. Do you do this with a work flow?