Share Pointers: Yes/No fields aren’t your friends



Email    print   
February 4, 2009 —  (Page 1 of 2)
Not too long ago, I was working with a client who reminded me of one of my least favorite nuances about SharePoint: Yes/No site columns.

It sounds pretty simple, right? Perhaps you need to make a list to store information about projects. You would create a new list and add the site columns to store the information for the project.  Imagine that one of the requirements is to create a field to answer the question, “Is this an open project?” You review your options and decide that, since this is a “yes” or “no” type question, clearly the Yes/No field type would be the best option for the job. Look at its name, it is so obvious this is the best option, right? Technically it would "work" just fine. But there's an issue.

Before we get ahead of ourselves, you may have used this field type before and be thinking to yourself, “It works just fine. I added the field and it shows up in my view as No." You are correct, you probably selected No in your list item, and when it saved, it will show up as No in your view.

But what actually happened is that behind the scenes, that No has been stored as a 0. If you had said Yes, it would have been stored as a 1. SharePoint knows how to interpret this and will display these 1s and 0s as Yes and No for your convenience.

This can cause confusion if you try to run searches or use things like the Content Query Web Part. For example, a user might create a CQWP that only shows projects that are listed as Open. The user would add the CQWP, set the filter criteria to look at the Yes/No field and set the filter value to Yes. However, no projects would show up in the CQWP, because in order to get the expected results, you would need to specify the filter value as 1, not Yes.



Related Search Term(s): SharePoint

Pages 1 2 


Share this link: http://sdt.bz/33246
 
Most Read Latest News Blog Resources


Comments


02/19/2009 08:37:12 AM EST

As a database programmer I would disagree. In fact, I would say that the CQWP is not performing as it should and thus should be changed. In my humble opinion, data fields should reflect, as closely as possible, the datatype stored within. You wouldn't use a varchar field to store timestamps, and you wouldn't use a decimal field to store integers. Why use an xxchar field to store bit values? I would humbly accept someone telling me that I'm wrong. Brian

United StatesBrian


Add comment


Name*
Email*  
Country     


  • Comment
Loading




close
NEXT ARTICLE
Why SharePoint development is so damn special!
Bjorn Furuknap has a few words about the travails associated with getting just the right SharePoint setup Read More...
 
 
 
 
News on Monday
more>>
SharePoint Tech Report
more>>


   

 
 

Download Current Issue
FEBRUARY 2012 PDF ISSUE

Need Back Issues?
DOWNLOAD HERE

Want to subscribe?


 
blogs tab
Are you at risk for burnout?
Burnout is a severe problem and it can strike at any time. Here's how to tell if you are nearing the edge.
02/09/2012 02:16 PM EST

Agility, mom, and apple pie
If we're to evaluate the state-of-the-art in software development, we should start with the values espoused in the Agile Manifesto.
02/07/2012 11:57 AM EST

RIM woos developers with free tablet
How do you get more apps ported to the BlackBerry PlayBook? By giving every developer a free tablet, of course!
02/04/2012 01:57 PM EST

GitHire: Use Headhunters to Find Your Perfect Programmer
Are you a hiring manager tired of scouring the job boards? Check out this new service that will find 5 people interested in your jobs.
02/03/2012 12:17 PM EST

Facebook claims hacker cred
Facebook's SEC S-1 filing form includes a short essay on the Hacker Way by Mark Zuckerberg himself.
02/02/2012 08:26 AM EST

Ryan Dahl steps down
Ryan Dahl, creator of Node.js, steps back from his position as gatekeeper for the project.
02/01/2012 04:58 PM EST

 
Events calendar tab
2/13/2012 to 2/16/2012
Santa Clara
TechWeb

2/26/2012 to 2/29/2012
San Francisco
BZ Media

2/27/2012 to 3/2/2012
San Francisco
RSA

3/4/2012 to 3/7/2012
Las Vegas
IBM Tivoli

3/5/2012 to 3/9/2012
San Francisco
TechWeb