<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SharePoint Help</title>
	<atom:link href="http://sharepointsolutions.com/sharepoint-help/feed/" rel="self" type="application/rss+xml" />
	<link>http://sharepointsolutions.com/sharepoint-help</link>
	<description>SharePoint Help Community Home</description>
	<lastBuildDate>Tue, 27 Mar 2012 18:28:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to Validate a Non-Required Column in SharePoint 2010</title>
		<link>http://sharepointsolutions.com/sharepoint-help/blog/2012/03/how-to-validate-a-non-required-column-in-sharepoint-2010/</link>
		<comments>http://sharepointsolutions.com/sharepoint-help/blog/2012/03/how-to-validate-a-non-required-column-in-sharepoint-2010/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 18:27:44 +0000</pubDate>
		<dc:creator>Ricky Spears</dc:creator>
				<category><![CDATA[For Developers]]></category>
		<category><![CDATA[For Users]]></category>
		<category><![CDATA[SharePoint 2010 RTM]]></category>

		<guid isPermaLink="false">http://sharepointsolutions.com/sharepoint-help/blog/2012/03/how-to-validate-a-non-required-column/</guid>
		<description><![CDATA[Wow! I never expected to write so many posts about Column Validation. Yet, here I am with the 5th post in what has become a series about Column Validation. Just to recap, here are the links to my previous posts on Column Validation:

&#160;How to Validate a Due Date in a SharePoint 2010 List
&#160;How to Validate [...]]]></description>
			<content:encoded><![CDATA[<p>Wow! I never expected to write so many posts about Column Validation. Yet, here I am with the 5th post in what has become a series about Column Validation. Just to recap, here are the links to my previous posts on Column Validation:</p>
<ul>
<li>&#160;<a href="http://sharepointsolutions.com/sharepoint-help/blog/2011/02/how-to-validate-a-due-date-in-a-sharepoint-2010-list/">How to Validate a Due Date in a SharePoint 2010 List</a></li>
<li>&#160;<a href="http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-strict-text-formats-in-sharepoint-2010/">How to Validate Strict Text Formats in SharePoint 2010</a></li>
<li>&#160;<a href="http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-an-email-address-using-column-validation-in-sharepoint-2010/">How to Validate an Email Address Using Column Validation in SharePoint 2010</a></li>
<li><a href="http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-use-or-type-options-in-sharepoint-2010-column-validation/">How to Use ‘OR’ Type Options in SharePoint 2010 Column Validation</a></li>
</ul>
<p>Also, if you would like to learn more about these techniques, with live demonstration and discussion, I’ll be speaking on Column Validation at July. 2012 meeting of the <a href="http://www.fedspug.org/">Federal SharePoint User’s Group</a> (FEDSPUG) in Washington, DC. Come on out, I would love to meet you!</p>
<p><strong>The Problem</strong></p>
<p>A reader asked, “I have form that does not require the ‘phone’ to be filled in. However I want to validate the entry if/when it is filled in. Is there a way to add string at end of the phone validation formula to accept a ‘null’ value to avoid validation error?” Yes, this is possible, and in this post I’ll show you how to do it.</p>
<p>In a nutshell, this is an ‘OR’ type of validation that I discussed in my post on <a href="http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-use-or-type-options-in-sharepoint-2010-column-validation/">How to Use ‘OR’ Type Options in SharePoint 2010 Column Validation</a>, with one of the options being no answer at all. In this post, I’ll look at a slightly different way of doing this than the exact way I did it in that post. The are multiple formulas that may work for many of these complex validation requirements, so there isn’t one single correct answer.</p>
<p><strong>A Simple Non-Required Validation Test</strong></p>
<p>Because some of the formulas for Column Validation can be quite complex, I like to set up a “proof of concept” type validation that is more simple first, then I can work on the more complex details.</p>
<p>So, I’ll first test the concept of validating something only if it exists. Then, once I have that working, I’ll integrate the formula I’ve already written for validating a phone number.</p>
<p>I’ve created a list with a column named “phone”. I’ve chose the “Single line of text” data type, set it to a maximum of 12-characters (three digits, a dash, 3 digits, a dash, and four digits), and made it not required. </p>
<p>Since I only want my column validation to run if the user enters something in the field, that is to say, if the field’s value isn’t NULL, my first thought was to use the <a href="http://office.microsoft.com/en-us/sharepoint-foundation-help/is-functions-HA100405908.aspx">ISNULL()</a> function and then wrap it in the&#160; <a href="http://office.microsoft.com/en-us/sharepoint-foundation-help/not-function-HA010380007.aspx">NOT()</a> function. <em>(Note: Microsoft has a section with information about available </em><a href="http://office.microsoft.com/en-us/sharepoint-foundation-help/CH010372694.aspx"><em>Formulas and Functions in SharePoint 2010</em></a><em>.) </em>This method should work fine on Number columns, however, a column of data type Single line of text isn’t NULL if it’s empty, it just has a string of no length. This moved me back in the direction of using nested IF() functions like I did in my post on <a href="http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-use-or-type-options-in-sharepoint-2010-column-validation/">How to Use ‘OR’ Type Options in SharePoint 2010 Column Validation</a>.</p>
<p>First, we’ll write a simple formula to only allow a blank phone number. This formula will look like this: <strong><em>=IF(LEN([Phone])=0,TRUE,FALSE)</em></strong> With this formula in place, if there is anything in the Phone field, it won’t validate. However, it validates fine if the field is empty.    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2012/03/image.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2012/03/image_thumb.png" width="360" height="82" /></a></p>
<p>Next, we’ll put a simple validation place of the FALSE result. Let’s try to only allow the letter “A” there. So a user can leave it blank, or they can enter a single letter “A”, but nothing else will be allowed. That formula will look like this: <strong><em>=IF(LEN([Phone])=0,TRUE,(IF([Phone]=”A”,TRUE,FALSE))</em></strong> </p>
<p>With this formula, only empty values, or values of a single letter “A” are allowed:   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2012/03/image1.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2012/03/image_thumb1.png" width="461" height="98" /></a></p>
<p><strong>Validating a Phone Number, But Only If One Is Entered</strong></p>
<p>Now that we have the general logic worked out, we need to replace that second condition (<strong><em>[Phone]=”A”</em></strong>) in the formula with the Phone number validation formula. You’ll remember from the post on <a href="http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-strict-text-formats-in-sharepoint-2010/">How to Validate Strict Text Formats in SharePoint 2010</a> to validate for ###-###-####, the formula is:    <br /><strong><em>=(LEN([Phone])=12)        <br />+(CODE(MID([Phone],1,1))&gt;47)         <br />+(CODE(MID([Phone],1,1))&lt;58)         <br />+(CODE(MID([Phone],2,1))&gt;47)         <br />+(CODE(MID([Phone],2,1))&lt;58)         <br />+(CODE(MID([Phone],3,1))&gt;47)         <br />+(CODE(MID([Phone],3,1))&lt;58)         <br />+(MID([Phone],4,1)=&quot;-&quot;)         <br />+(CODE(MID([Phone],5,1))&gt;47)         <br />+(CODE(MID([Phone],5,1))&lt;58)         <br />+(CODE(MID([Phone],6,1))&gt;47)         <br />+(CODE(MID([Phone],6,1))&lt;58)         <br />+(CODE(MID([Phone],7,1))&gt;47)         <br />+(CODE(MID([Phone],7,1))&lt;58)         <br />+(MID([Phone],8,1)=&quot;-&quot;)         <br />+(CODE(MID([Phone],9,1))&gt;47)         <br />+(CODE(MID([Phone],9,1))&lt;58)         <br />+(CODE(MID([Phone],10,1))&gt;47)         <br />+(CODE(MID([Phone],10,1))&lt;58)         <br />+(CODE(MID([Phone],11,1))&gt;47)         <br />+(CODE(MID([Phone],11,1))&lt;58)         <br />+(CODE(MID([Phone],12,1))&gt;47)         <br />+(CODE(MID([Phone],12,1))&lt;58)         <br />=23</em></strong></p>
<p>To make it easier to read, let’s separate the original formula so the parts are on separate lines. It looks like this:   <br /><strong><em>=IF(       <br /></em></strong><strong><em>&#160; LEN([Phone])=0       <br />&#160;&#160;&#160; ,</em></strong><strong><em>TRUE       <br />&#160;&#160;&#160; ,(IF([Phone]=”A”        <br />&#160;&#160;&#160;&#160;&#160; ,TRUE        <br />&#160;&#160;&#160;&#160;&#160; ,FALSE        <br />&#160;&#160;&#160; )        <br />)</em></strong> </p>
<p>If we replace the second condition with the Phone Number Validation Condition, it looks like this:   </p>
<p><em><strong>=IF(       <br />&#160; LEN([Phone])=0        <br />&#160;&#160;&#160; ,TRUE        <br />&#160;&#160;&#160; ,(IF(        <br /></strong></em><strong><em>(LEN([Phone])=12)        <br />+(CODE(MID([Phone],1,1))&gt;47)         <br />+(CODE(MID([Phone],1,1))&lt;58)         <br />+(CODE(MID([Phone],2,1))&gt;47)         <br />+(CODE(MID([Phone],2,1))&lt;58)         <br />+(CODE(MID([Phone],3,1))&gt;47)         <br />+(CODE(MID([Phone],3,1))&lt;58)         <br />+(MID([Phone],4,1)=&quot;-&quot;)         <br />+(CODE(MID([Phone],5,1))&gt;47)         <br />+(CODE(MID([Phone],5,1))&lt;58)         <br />+(CODE(MID([Phone],6,1))&gt;47)         <br />+(CODE(MID([Phone],6,1))&lt;58)         <br />+(CODE(MID([Phone],7,1))&gt;47)         <br />+(CODE(MID([Phone],7,1))&lt;58)         <br />+(MID([Phone],8,1)=&quot;-&quot;)         <br />+(CODE(MID([Phone],9,1))&gt;47)         <br />+(CODE(MID([Phone],9,1))&lt;58)         <br />+(CODE(MID([Phone],10,1))&gt;47)         <br />+(CODE(MID([Phone],10,1))&lt;58)         <br />+(CODE(MID([Phone],11,1))&gt;47)         <br />+(CODE(MID([Phone],11,1))&lt;58)         <br />+(CODE(MID([Phone],12,1))&gt;47)         <br />+(CODE(MID([Phone],12,1))&lt;58)         <br />=23        <br /></em></strong><strong><em>&#160;&#160;&#160;&#160;&#160; ,TRUE       <br />&#160;&#160;&#160;&#160;&#160; ,FALSE        <br />&#160;&#160;&#160; )        <br />)</em></strong></p>
<p>Although this does correctly validate and only allow phone numbers in the ###-###-#### format, it doesn’t display our nice friendly error message when a user enters in invalid information. It displays:   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2012/03/image2.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2012/03/image_thumb2.png" width="516" height="83" /></a>    <br />instead of:    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2012/03/image3.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2012/03/image_thumb3.png" width="620" height="97" /></a>    </p>
<p>As I discussed in the post on <a href="http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-use-or-type-options-in-sharepoint-2010-column-validation/">How to Use ‘OR’ Type Options in SharePoint 2010 Column Validation</a>, this is because the formula is trying to evaluate characters that don’t exist. Let’s change our formula to only check the individual characters if it is 12-characters long. With this extra condition, our stub formula will look like this:    </p>
<p> <strong><em>=IF(     <br /></em></strong><strong><em>&#160; LEN([Phone])=0     <br />&#160;&#160;&#160; ,</em></strong><strong><em>TRUE     <br />&#160;&#160;&#160; ,(IF(LEN([Phone])=12      <br />&#160;&#160;&#160;&#160;&#160; ,TRUE      <br />&#160;&#160;&#160;&#160;&#160; ,FALSE      <br />&#160;&#160;&#160; )      <br />)</em></strong>
<p>This stub formula will work and only allow blank phone numbers or phone numbers that are 12-digits long. To add the testing for the proper characters, we’ll need to wrap the phone number validation formula in an IF() statement and replace the second TRUE result with it. Because this second statement will only run if it’s 12-characters long, we don’t need to include that part of the formula and the sum will be 22 instead of 23. Our formula will look like this:</p>
<p><strong><em>=IF(       <br />&#160; LEN([Phone])=0        <br />&#160;&#160;&#160; ,TRUE        <br />&#160;&#160;&#160; ,(IF(LEN([Phone])=12        <br />&#160;&#160;&#160;&#160;&#160; ,</em></strong>IF((    <br />(CODE(MID([Phone],1,1))&gt;47)     <br />+(CODE(MID([Phone],1,1))&lt;58)     <br />+(CODE(MID([Phone],2,1))&gt;47)     <br />+(CODE(MID([Phone],2,1))&lt;58)     <br />+(CODE(MID([Phone],3,1))&gt;47)     <br />+(CODE(MID([Phone],3,1))&lt;58)     <br />+(MID([Phone],4,1)=&quot;-&quot;)     <br />+(CODE(MID([Phone],5,1))&gt;47)     <br />+(CODE(MID([Phone],5,1))&lt;58)     <br />+(CODE(MID([Phone],6,1))&gt;47)     <br />+(CODE(MID([Phone],6,1))&lt;58)     <br />+(CODE(MID([Phone],7,1))&gt;47)     <br />+(CODE(MID([Phone],7,1))&lt;58)     <br />+(MID([Phone],8,1)=&quot;-&quot;)     <br />+(CODE(MID([Phone],9,1))&gt;47)     <br />+(CODE(MID([Phone],9,1))&lt;58)     <br />+(CODE(MID([Phone],10,1))&gt;47)     <br />+(CODE(MID([Phone],10,1))&lt;58)     <br />+(CODE(MID([Phone],11,1))&gt;47)     <br />+(CODE(MID([Phone],11,1))&lt;58)     <br />+(CODE(MID([Phone],12,1))&gt;47)     <br />+(CODE(MID([Phone],12,1))&lt;58)     <br />=22    <br />),TRUE,FALSE)<strong><em>       <br /></em></strong><strong><em>&#160;&#160;&#160;&#160;&#160; ,FALSE       <br />&#160;&#160;&#160; )        <br />)</em></strong> </p>
<p>Whew! That was a lot of work, but we did it. With that formula, our list doesn’t require a phone number to be entered, but if one is entered, it must be in the proper format.   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2012/03/image4.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2012/03/image_thumb4.png" width="631" height="97" /></a></p>
<p>I’m really enjoying working through these column validation questions and issues and look forward to hearing what others need to validate. Of course, hopefully, the series has been written so that you’ve learned to do this yourself and you’ll be sharing your formulas in the comments instead of asking for new ones. <img style="border-bottom-style: none;border-left-style: none;border-top-style: none;border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://sharepointsolutions.com/sharepoint-help/files/2012/03/wlEmoticon-smile.png" /></p>
<p>Happy validating!</p>
]]></content:encoded>
			<wfw:commentRss>http://sharepointsolutions.com/sharepoint-help/blog/2012/03/how-to-validate-a-non-required-column-in-sharepoint-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Use ‘OR’ Type Options in SharePoint 2010 Column Validation</title>
		<link>http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-use-or-type-options-in-sharepoint-2010-column-validation/</link>
		<comments>http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-use-or-type-options-in-sharepoint-2010-column-validation/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 14:00:21 +0000</pubDate>
		<dc:creator>Ricky Spears</dc:creator>
				<category><![CDATA[For Developers]]></category>
		<category><![CDATA[For Users]]></category>
		<category><![CDATA[SharePoint 2010 RTM]]></category>

		<guid isPermaLink="false">http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-use-or-type-options-in-sharepoint-2010-column-validation/</guid>
		<description><![CDATA[I didn’t originally set out to write a series of posts on Column Validation in SharePoint 2010, but I keep thinking of new challenges each time I do. I have no idea how long this series may go (in fact, this may be the last one), but this is the third in the series. Here [...]]]></description>
			<content:encoded><![CDATA[<p>I didn’t originally set out to write a series of posts on Column Validation in SharePoint 2010, but I keep thinking of new challenges each time I do. I have no idea how long this series may go (in fact, this may be the last one), but this is the third in the series. Here are links to the previous two posts:</p>
<ol>
<li><a href="http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-strict-text-formats-in-sharepoint-2010/">How to Validate Strict Text Formats in SharePoint 2010</a></li>
<li><a href="http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-an-email-address-using-column-validation-in-sharepoint-2010/">How to Validate an Email Address Using Column Validation in SharePoint 2010</a></li>
</ol>
<p>In today’s post we’ll look at how we might allow users to enter data in a one of a couple different formats. The example that comes to mind is US Postal Service ZIP Code validation. Two ZIP Code formats are allowed: the old 5-digit format and the ZIP+4 format that we started using the 1980’s (5-digits, followed by a dash, followed by four more digits).</p>
<p>Using what you learned in my first post of the series you can probably easily write a formula to validate each one of those. Instead of walking through each step of writing those, I’ll just write them for you here:</p>
<p><strong>ZIP Code Validation Formula:</strong></p>
<p><strong><em>=(LEN([ZIP Code])=5)        <br />+(CODE(MID([ZIP Code],1,1))&gt;47)         <br />+(CODE(MID([ZIP Code],1,1))&lt;58)         <br />+(CODE(MID([ZIP Code],2,1))&gt;47)         <br />+(CODE(MID([ZIP Code],2,1))&lt;58)         <br />+(CODE(MID([ZIP Code],3,1))&gt;47)         <br />+(CODE(MID([ZIP Code],3,1))&lt;58)         <br />+(CODE(MID([ZIP Code],4,1))&gt;47)         <br />+(CODE(MID([ZIP Code],4,1))&lt;58)         <br />+(CODE(MID([ZIP Code],5,1))&gt;47)         <br />+(CODE(MID([ZIP Code],5,1))&lt;58)        <br />=11</em></strong></p>
<p><strong>ZIP+4 Validation Formula:</strong></p>
<p><strong><em>=(LEN([ZIP Code])=10)        <br />+(CODE(MID([ZIP Code],1,1))&gt;47)         <br />+(CODE(MID([ZIP Code],1,1))&lt;58)         <br />+(CODE(MID([ZIP Code],2,1))&gt;47)         <br />+(CODE(MID([ZIP Code],2,1))&lt;58)         <br />+(CODE(MID([ZIP Code],3,1))&gt;47)         <br />+(CODE(MID([ZIP Code],3,1))&lt;58)         <br />+(CODE(MID([ZIP Code],4,1))&gt;47)         <br />+(CODE(MID([ZIP Code],4,1))&lt;58)         <br />+(CODE(MID([ZIP Code],5,1))&gt;47)         <br />+(CODE(MID([ZIP Code],5,1))&lt;58)        <br />+(MID([ZIP Code],6,1)=&quot;-&quot;)         <br />+(CODE(MID([ZIP Code],7,1))&gt;47)         <br />+(CODE(MID([ZIP Code],7,1))&lt;58)        <br />+(CODE(MID([ZIP Code],8,1))&gt;47)         <br />+(CODE(MID([ZIP Code],8,1))&lt;58)        <br />+(CODE(MID([ZIP Code],9,1))&gt;47)         <br />+(CODE(MID([ZIP Code],9,1))&lt;58)        <br />+(CODE(MID([ZIP Code],10,1))&gt;47)         <br />+(CODE(MID([ZIP Code],10,1))&lt;58)        <br />=20</em></strong></p>
<p><strong>Set Up a Sandbox List for Experimenting</strong></p>
<p>Since I’m using these blog posts to teach how to do column validation formatting instead of just giving you the formulas without much explanation, let’s create a sandbox list we can play in and see what is going on. We’ll need 3 columns in the list: a Single line of text for the ZIP Code, a calculated field that uses the first formula for the ZIP Formula, and another calculated field that uses the ZIP+4 Formula. I’ve set that up here and entered a couple examples:   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image27.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb27.png" width="644" height="125" /></a></p>
<p>Because those formulas are so long, we’ll write our initial formula using the ZIP Formula column and ZIP=4 Formula column. Then we’ll replace those with the full formulas.</p>
<p><strong>The Logic – Introducing the Undocumented OR() Formula</strong></p>
<p>Let’s create a new calculated column in our sandbox list and call it Combined Formula. Although I found information about the <strong>AND()</strong> formula, I didn’t see any documentation about an <strong>OR()</strong> function. I decided to try it and see if it would work anyway. It did! At least, part way. Enter in a formula of <strong><em>=OR([ZIP Formula],[ZIP+4 Formula])</em></strong>. You’ll notice you get the following results:    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image28.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb28.png" width="644" height="112" /></a></p>
<p><strong>Dealing with Errors</strong></p>
<p>See those #VALUE! Errors? Ultimately, we know those are No’s, but SharePoint sees them as errors. When a validation formula encounters an error it will give the user an error instead of the message you want. Here is a screenshot showing what the user sees when a validation formula encounters an unchecked error.   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image29.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb29.png" width="644" height="98" /></a>    <br />What we wanted them to see was this:    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image30.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb30.png" width="644" height="81" /></a></p>
<p>We can handle this with the ISERROR() formula we used in yesterday’s post. We’ll also combine it with the IF() function I mentioned briefly in the first post. The IF() function accepts three comma separated parameters: the item to test, the result if the test is true, and the result if the test is false.</p>
<p>To see this in action, let’s work with one column at a time in our Combined Column. Change the formula for this column to <strong><em>=IF(ISERROR([ZIP Formula]),FALSE,IF([ZIP Formula],TRUE,FALSE))</em></strong>. What this does is test for an error first. If it encounters an error then it sets the field to FALSE, if it doesn’t encounter an error, then it checks to see if the formula evaluates to True or False and sets the value accordingly.</p>
<p>This gives us the accurate Yes’s and No’s about the ZIP Formula, without the errors:   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image31.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb31.png" width="644" height="117" /></a></p>
<p>Now that we have that working with the ZIP Formula column, let’s modify it to use the ZIP+4 Formula column. That’s as simple as changing the column names: <strong><em>=IF(ISERROR([ZIP+4 Formula]),FALSE,IF([ZIP+4 Formula],TRUE,FALSE))</em></strong>.</p>
<p>Notice this also correctly tells us that the last test is the only one that fits our ZIP+4 criteria:   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image32.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb32.png" width="644" height="120" /></a></p>
<p><strong>Back to the Logic</strong></p>
<p>Now that we have the errors all worked out, let’s use the OR() function to see if either of them are valid. Here is what the formula will look like: <strong><em>=OR((IF(ISERROR([ZIP Formula]),FALSE,IF([ZIP Formula],TRUE,FALSE))),(IF(ISERROR([ZIP+4 Formula]),FALSE,IF([ZIP+4 Formula],TRUE,FALSE))))</em></strong>. Notice that this shows us that either of the last two entries are valid, but neither of the first two are:    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image33.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb33.png" width="644" height="117" /></a></p>
<p><strong>Putting It All Together</strong></p>
<p>Chances are pretty good that you don’t want to add two extra columns to your SharePoint list every time you have a ZIP Code column for validation purposes. So we’ll need to put our original formulas in the place of the column names we used in our last formula. If you’re thinking, “This is going to be one really long formula!” then you’re absolutely correct!</p>
<p>To make things easier, let’s take that last formula and break it out on different lines and add some indentation so it’s easier to read:</p>
<p><strong><em>=OR(       <br />&#160; (        <br />&#160;&#160;&#160; IF(ISERROR(        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; [ZIP Formula]        <br />&#160;&#160;&#160;&#160;&#160; )        <br />&#160;&#160;&#160;&#160;&#160; ,FALSE        <br />&#160;&#160;&#160;&#160;&#160; ,IF(        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; [ZIP Formula]        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ,TRUE        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ,FALSE        <br />&#160;&#160;&#160;&#160;&#160;&#160; )        <br />&#160;&#160;&#160;&#160;&#160; ))        <br />&#160;&#160;&#160; ,(IF(ISERROR(        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; [ZIP+4 Formula]        <br />&#160;&#160;&#160;&#160;&#160; )        <br />&#160;&#160;&#160;&#160;&#160; ,FALSE        <br />&#160;&#160;&#160;&#160;&#160; ,IF(        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; [ZIP+4 Formula]        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ,TRUE        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ,FALSE        <br />&#160;&#160;&#160; ))        <br />&#160; )        <br />)</em></strong></p>
<p>Now that you have that, simple replace both instances of [ZIP Formula] with the first formula from the beginning of this post and both instances of the [ZIP=4 Formula] with the second formula (remember to drop the equals sign at the beginning and wrap it in parenthesis). This will give you a completed formula that looks like this:</p>
<p><strong><em>=OR(       <br />&#160; (        <br />&#160;&#160;&#160; IF(ISERROR(        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ((LEN([ZIP Code])=5)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],1,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],1,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],2,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],2,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],3,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],3,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],4,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],4,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],5,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],5,1))&lt;58)        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; =11)        <br />&#160;&#160;&#160;&#160;&#160; )        <br />&#160;&#160;&#160;&#160;&#160; ,FALSE        <br />&#160;&#160;&#160;&#160;&#160; ,IF(        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ((LEN([ZIP Code])=5)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],1,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],1,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],2,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],2,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],3,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],3,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],4,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],4,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],5,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],5,1))&lt;58)        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; =11)        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ,TRUE        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ,FALSE        <br />&#160;&#160;&#160;&#160;&#160;&#160; )        <br />&#160;&#160;&#160;&#160;&#160; ))        <br />&#160;&#160;&#160; ,(IF(ISERROR(        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ((LEN([ZIP Code])=10)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],1,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],1,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],2,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],2,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],3,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],3,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],4,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],4,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],5,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],5,1))&lt;58)        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(MID([ZIP Code],6,1)=&quot;-&quot;)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],7,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],7,1))&lt;58)        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],8,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],8,1))&lt;58)        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],9,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],9,1))&lt;58)        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],10,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],10,1))&lt;58)        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; =20)        <br />&#160;&#160;&#160;&#160;&#160; )        <br />&#160;&#160;&#160;&#160;&#160; ,FALSE        <br />&#160;&#160;&#160;&#160;&#160; ,IF(        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ((LEN([ZIP Code])=10)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],1,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],1,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],2,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],2,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],3,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],3,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],4,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],4,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],5,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],5,1))&lt;58)        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(MID([ZIP Code],6,1)=&quot;-&quot;)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],7,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],7,1))&lt;58)        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],8,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],8,1))&lt;58)        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],9,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],9,1))&lt;58)        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],10,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID([ZIP Code],10,1))&lt;58)        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; =20)        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ,TRUE        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ,FALSE        <br />&#160;&#160;&#160; ))        <br />&#160; )        <br />)</em></strong></p>
<p>Whew! Now that’s what I call validation!</p>
<p>Before we add this to our validation field, let’s test the combined formula in our Combined Formula calculated column. As you can see, this gives us the same result we got before:   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image34.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb34.png" width="644" height="118" /></a></p>
<p><strong>1024 Character Limit for Column Validation Formulas</strong></p>
<p>If you paste this formula into the Column Validation field on the ZIP Code column, you’ll notice that it trims it about half-way. Microsoft is enforcing a 1,024-character limit on Column Validation formulas and this formula has 2,815-characters with the indented spacing. If we remove all the extra spaces, that brings it down to 2,135-characters, bit that’s still 1,111 too many. If we change our column name from ZIP Code to simply ZIP, we can save 7-characters each time we reference it (we don’t have to use the square brackets for single word column names). This brings us down to 1,704-characters. We still need to eliminate 680 characters. Can we do it?</p>
<p>The first formula is now 279-characters and the second formula is now 511-characters. If we can reference each formula only once, that will save 790-characters and get us under our limit. Hmmm…</p>
<p><strong>Rephrasing the Solution</strong></p>
<p>As it turns out, there is a way to only reference each formula one time. We only need to use the ZIP formula if the user entered 5-characters and we only need to use the ZIP+4 formula if the user entered 10-characters. Anything except 5- or 10-characters is not valid, so we don’t need to test that. This also means that we don’t need to do any error checking. <img style="border-bottom-style: none;border-left-style: none;border-top-style: none;border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/wlEmoticon-smile1.png" /></p>
<p>So, let’s begin with an IF() statement this time that just tests to see if the input is 5-characters long: <strong><em>=IF(LEN(ZIP)=5,TRUE,FALSE)</em></strong>.</p>
<p>Then we’ll add in the test for 10-characters long if it fails the 5-character test: <strong><em>=IF(LEN(ZIP)=5,TRUE,(IF(LEN(ZIP)=10,TRUE,FALSE)))</em></strong>.</p>
<p>Let’s write this with some indentation so we can see what we’re working with. We can always replace the spaces if we need more characters.</p>
<p><strong><em>=IF(       <br />&#160; LEN(ZIP)=5        <br />&#160;&#160;&#160; ,TRUE        <br />&#160;&#160;&#160; ,(IF(        <br />&#160;&#160;&#160;&#160;&#160; LEN(ZIP)=10        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ,TRUE        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ,FALSE        <br />&#160;&#160;&#160; ))        <br />)</em></strong></p>
<p>Now, all we need to do is replace the TRUE portions of this formula with the tests we want to run. We can also exclude the length test now too. So, here is what the formula looks like:</p>
<p><strong><em>=IF(       <br />&#160; LEN(ZIP)=5        <br />&#160;&#160;&#160; ,( (CODE(MID(ZIP,1,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,1,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,2,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,2,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,3,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,3,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,4,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,4,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,5,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,5,1))&lt;58)        <br />&#160;&#160;&#160;&#160;&#160; =10)        <br />&#160;&#160;&#160; ,(IF(        <br />&#160;&#160;&#160;&#160;&#160; LEN(ZIP)=10        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ,((CODE(MID(ZIP,1,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,1,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,2,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,2,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,3,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,3,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,4,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,4,1))&lt;58)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,5,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,5,1))&lt;58)        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(MID(ZIP,6,1)=&quot;-&quot;)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,7,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,7,1))&lt;58)        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,8,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,8,1))&lt;58)        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,9,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,9,1))&lt;58)        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,10,1))&gt;47)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; +(CODE(MID(ZIP,10,1))&lt;58)        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; =19)        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ,FALSE        <br />&#160;&#160;&#160; ))        <br />)</em></strong></p>
<p>That’s 1088-characters with the spaces for indentation—816 if we remove all the spaces. We did it! In fact, it could probably made even smaller by checking the first five characters separately from the last 5. I’ll leave that as a homework exercise for you though. <img style="border-bottom-style: none;border-left-style: none;border-top-style: none;border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/wlEmoticon-winkingsmile.png" /></p>
<p><strong>Implementing the Solution</strong></p>
<p>Now let’s try out the formula, add a friendly validation message, and try to enter some valid and invalid Zip Codes.</p>
<p>Notice that anything that doesn’t meet our strict criteria displays our friendly error message:   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image35.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb35.png" width="644" height="97" /></a></p>
<p><strike><strong>What Have We Learned?</strong></strike></p>
<p>I’ve been all over the place in this post, but I think you’ve learned a lot. Let me summarize:</p>
<ul>
<li>It is possible to have multiple options that are valid (‘OR’ type options).</li>
<li>This can be accomplished through IF() functions and/or the OR() function.</li>
<li>Validation formulas that result in an error, rather than TRUE or FALSE, will show an unfriendly error message instead of the friendly error the user entered.</li>
<li>ISERROR() can be used to trap errors if they may be encountered.</li>
<li>There is a 1024-character limit to Column Validation formulas.</li>
<li>Columns with a single name don’t need square brackets around them in formulas.</li>
<li>The most obvious formulas can often be shortened by looking at the problem a different way.</li>
</ul>
<p>Is there anything I haven’t touched on in these three posts? What other kinds of validation have you not been able to do? Let me know in the comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-use-or-type-options-in-sharepoint-2010-column-validation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Validate an Email Address Using Column Validation in SharePoint 2010</title>
		<link>http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-an-email-address-using-column-validation-in-sharepoint-2010/</link>
		<comments>http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-an-email-address-using-column-validation-in-sharepoint-2010/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 14:10:53 +0000</pubDate>
		<dc:creator>Ricky Spears</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-an-email-address-using-column-validation-in-sharepoint-2010/</guid>
		<description><![CDATA[Yesterday I showed you how to use Column Validation to validate Social Security Numbers, Phone Numbers, Employee Numbers, Part Numbers, and other things with strict formatting. Today I’m going to expand on that idea by showing you something more complex—we’re going to validate that an acceptable email address has been entered.
The formula we’ll write in [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I showed you <a href="http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-strict-text-formats-in-sharepoint-2010/" target="_blank">how to use Column Validation to validate Social Security Numbers, Phone Numbers, Employee Numbers, Part Numbers, and other things with strict formatting</a>. Today I’m going to expand on that idea by showing you something more complex—we’re going to validate that an acceptable email address has been entered.</p>
<p>The formula we’ll write in this post won’t catch every possible bad email address, but it’s designed to catch the most common mistakes. I’ll begin with the entire formula, then I’ll break it down and explain what’s going on piece by piece. This formula checks to see that the email address contains some characters, followed by an ampersand, more characters, a dot, and more characters—it also checks to make sure it doesn’t include a space character. Here is the formula:</p>
<p><strong><em>=(LEN(LEFT([Email],FIND(&quot;@&quot;,[Email])-1))&gt;0)       <br />+(LEN(RIGHT([Email],LEN([Email])-FIND(&quot;.&quot;,[Email],FIND(&quot;@&quot;,[Email]))))&gt;0)        <br />+(LEN(MID([Email],FIND(&quot;@&quot;,[Email])+1,FIND(&quot;.&quot;,[Email],FIND(&quot;@&quot;,[Email]))-FIND(&quot;@&quot;,[Email])-1))&gt;0)        <br />+(ISERROR(FIND(&quot; &quot;,[Email]))=TRUE)        <br />=4</em></strong></p>
<p>Whew! What a formula. Let’s break it down…</p>
<p><strong>Finding the Ampersand</strong></p>
<p>The first thing we want to do is find the position of the ampersand in the string the user enters. I’ve created a custom list to work with. I’ve added a column named Email (of type Single line of text) that will be where the user enters the e-mail address and I’ve added a calculated column named Ampersand to store the position of the ampersand (we won’t need this column for the validation, but it will help you understand how this formula works). We’ll use the FIND function to get this character location (<a href="http://office.microsoft.com/en-us/sharepoint-foundation-help/CH010372694.aspx?CTT=97" target="_blank">Click here for details about all the formulas and functions that are available to you for column validation</a>). The formula for the Ampersand column is <strong><em>=FIND(“@”,[Email])</em></strong>.</p>
<p><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image11.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb11.png" width="313" height="484" /></a></p>
<p>If we enter in an email address of <a href="mailto:test@testing.com">test@testing.com</a>, you’ll notice this column correctly populates with <strong><em>5</em></strong>.    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image12.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb12.png" width="644" height="73" /></a></p>
<p><strong>Find the Characters Before the Ampersand</strong></p>
<p>You’ll remember that we need to make sure the ampersand isn’t the first character in the email address. So the next thing we want to do is get all the text that is before the email address. To do that we’ll add a calculated column named First and use the formula <strong><em>=LEFT([Email],FIND(&quot;@&quot;,[Email]))</em></strong>. </p>
<p>This results in “test@”:   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image13.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb13.png" width="644" height="71" /></a></p>
<p>We don’t need the @ sign on the end of it, but the LEFT() function gives us everything up to and including the position we give it. So we’ll need to subtract one from it for it to be correct. Let’s change it to <strong><em>=LEFT([Email],FIND(&quot;@&quot;,[Email])-1)</em></strong>. This gives us what we want.    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image14.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb14.png" width="644" height="75" /></a>    </p>
<p>Now that we have that, we can see how many characters long it is by using the <strong><em>LEN()</em></strong> function. Let’s add another column named FirstLen that uses that function around all this, like so: <strong><em>=LEN(LEFT([Email],FIND(&quot;@&quot;,[Email])-1))</em></strong>. </p>
<p>You’ll notice this column contains 4 for the original example and it contains 0 if we enter in an email address of just “@.”   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image15.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb15.png" width="644" height="95" /></a></p>
<p>We know that this length must be greater than zero to validate, so, with that we now we have the first part of our column validation for the Email column:   <br /><strong><em>=(LEN(LEFT([Email],FIND(&quot;@&quot;,[Email])-1))&gt;0)       <br /></em></strong></p>
<p>If we enter this and try to add an email address that begins with an ampersand, or doesn’t contain an ampersand at all, we’ll get an error.   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image16.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb16.png" width="644" height="86" /></a></p>
<p><strong>Find the Characters After the Dot</strong></p>
<p>You’ve probably already figured out that you can find the location of the dot by using the formula&#160; <strong><em>=FIND(&quot;.&quot;,[Email])</em></strong>. However, if someone enters an email address with a dot before the ampersand (such as <a href="mailto:testy.tester@testing.com">testy.tester@testing.com</a>) this will cause a problem for our formula. We need to find a dot that is after the ampersand. We can modify the FIND() formula to start looking where the ampersand is though by changing it to: <strong><em>=FIND(&quot;.&quot;,[Email],FIND(&quot;@&quot;,[Email]))</em></strong>.</p>
<p>Let’s create a calculated column called dot with this formula. Notice this correctly shows us the position of a dot that is after the ampersand.   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image17.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb17.png" width="644" height="115" /></a></p>
<p>We’re almost ready to use the RIGHT() function to extract the characters we need. Let’s create a calculated column named Right and use the formula: =RIGHT([Email],FIND(&quot;.&quot;,[Email],FIND(&quot;@&quot;,[Email])))   </p>
<p>You’ll notice this gives us far more than just the few characters we want:   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image18.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb18.png" width="644" height="107" /></a></p>
<p>This is because the RIGHT() function begins with the character we give it <em>from the left, not from the right</em>. So we need to translate that to characters from the <em>right</em>. We can do that by simply subtracting that number from the length of the whole string using the LEN() function. Let’s modify the formula like this: <strong><em>=RIGHT([Email],LEN([Email])-FIND(&quot;.&quot;,[Email],FIND(&quot;@&quot;,[Email]))</em></strong></p>
<p>This gives us what we want.   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image19.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb19.png" width="644" height="111" /></a></p>
<p>Now we just need to get the length of that piece. We’ll create a new calculated column called RightLen and use the formula: <strong><em>=LEN(RIGHT([Email],LEN([Email])-FIND(&quot;.&quot;,[Email],FIND(&quot;@&quot;,[Email]))))</em></strong></p>
<p><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image20.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb20.png" width="644" height="109" /></a></p>
<p>Since this is working correctly, we can add that to our validation rule on the Email column to check to make sure this value is greater than zero. Here is the Email Validation formula so far:</p>
<p> <strong><em>=(LEN(LEFT([Email],FIND(&quot;@&quot;,[Email])-1))&gt;0)     <br />+(LEN(RIGHT([Email],LEN([Email])-FIND(&quot;.&quot;,[Email],FIND(&quot;@&quot;,[Email]))))&gt;0)      <br />=2</em></strong>
<p>If we try to enter an email address without a top level domain on the end, we get the error.   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image21.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb21.png" width="644" height="85" /></a></p>
<p><strong>Find the Characters Between the Ampersand and the Dot</strong>    </p>
<p>We can’t have a valid email address without a domain name between the ampersand and the dot. So now we need to figure out how to check for that. For this we’ll use the MID() function and all the skills you’ve learned up to this point. Create a new calculated column named Middle and use the formula: <strong><em>=MID([Email],FIND(&quot;@&quot;,[Email])+1,FIND(&quot;.&quot;,[Email],FIND(&quot;@&quot;,[Email]))-FIND(&quot;@&quot;,[Email])-1)</em></strong></p>
<p>This correctly gives us the domain name of the email address:   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image22.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb22.png" width="644" height="96" /></a></p>
<p>We’ll create a calculated column named MiddleLen and wrap the formula in a LEN() function to give the length of this part, like so: <strong><em>=LEN(MID([Email],FIND(&quot;@&quot;,[Email])+1,FIND(&quot;.&quot;,[Email],FIND(&quot;@&quot;,[Email]))-FIND(&quot;@&quot;,[Email])-1))</em></strong></p>
<p>This correctly gives us:   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image23.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb23.png" width="644" height="125" /></a></p>
<p>We now have the bulk of our email validation formula done. We just need it to check if the length of all three parts is greater than zero. Here is the Email Validation formula so far:</p>
<p> <strong><em>=(LEN(LEFT([Email],FIND(&quot;@&quot;,[Email])-1))&gt;0)     <br />+(LEN(RIGHT([Email],LEN([Email])-FIND(&quot;.&quot;,[Email],FIND(&quot;@&quot;,[Email]))))&gt;0)      <br />+(LEN(MID([Email],FIND(&quot;@&quot;,[Email])+1,FIND(&quot;.&quot;,[Email],FIND(&quot;@&quot;,[Email]))-FIND(&quot;@&quot;,[Email])-1))&gt;0)      <br />=3</em></strong>
<p>If we try to use this and leave out the domain portion, we’ll get an error.   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image24.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb24.png" width="644" height="82" /></a></p>
<p><strong>Check for Spaces in the Email Address</strong></p>
<p>As a final addition to our formula, we’re going to check for a space in the email address. We know that it’s easy to accidentally press the space-bar while typing, but spaces aren’t allowed. </p>
<p>Let’s add a new calculated column named SpacePos and use the following formula to find the position of any space: <strong><em>=FIND(&quot; &quot;,[Email])</em></strong></p>
<p>Notice the column contains a #VALUE error if the Email address doesn’t contain a space and the position of the space character if it does.   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image25.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb25.png" width="644" height="142" /></a></p>
<p>There is another function called ISERROR() that allows us to check for these kinds of errors. Change the formula on the SpacePos column to: <strong><em>ISERROR(FIND(&quot; &quot;,[Email]))</em></strong></p>
<p>Notice that the ones that don’t contain a space evaluate to TRUE and the one that does evaluates to FALSE:   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image26.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb26.png" width="644" height="141" /></a></p>
<p>We can now use this as a fourth piece of criteria to check in our formula by adding it to our email validation formula. Here is the complete formula:</p>
<p><strong><em>=(LEN(LEFT([Email],FIND(&quot;@&quot;,[Email])-1))&gt;0)       <br />+(LEN(RIGHT([Email],LEN([Email])-FIND(&quot;.&quot;,[Email],FIND(&quot;@&quot;,[Email]))))&gt;0)        <br />+(LEN(MID([Email],FIND(&quot;@&quot;,[Email])+1,FIND(&quot;.&quot;,[Email],FIND(&quot;@&quot;,[Email]))-FIND(&quot;@&quot;,[Email])-1))&gt;0)        <br />+(ISERROR(FIND(&quot; &quot;,[Email]))=TRUE)        <br />=4</em></strong></p>
<p><strong>More…</strong></p>
<p>I hope this has been helpful and inspires you to do more serious data validation. If it does, please share any helpful formulas you discover in the comments. If you have things that you just can’t seem to figure out how to validate, share those as well and perhaps someone else can help with those. Almost anything you need to validate is possible with a little work.</p>
]]></content:encoded>
			<wfw:commentRss>http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-an-email-address-using-column-validation-in-sharepoint-2010/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Validate Strict Text Formats in SharePoint 2010</title>
		<link>http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-strict-text-formats-in-sharepoint-2010/</link>
		<comments>http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-strict-text-formats-in-sharepoint-2010/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 18:30:36 +0000</pubDate>
		<dc:creator>Ricky Spears</dc:creator>
				<category><![CDATA[For Developers]]></category>
		<category><![CDATA[For Server Administrators]]></category>
		<category><![CDATA[For Users]]></category>
		<category><![CDATA[SharePoint 2010 RTM]]></category>

		<guid isPermaLink="false">http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-strict-text-formats-in-sharepoint-2010/</guid>
		<description><![CDATA[We often need to ensure that users enter text information in a specific way. For example, perhaps our company uses part numbers such as TL-1400 and RW-1555. Every part number begins with two letters, followed by a dash, followed by four digits. Or perhaps we use Social Security Numbers in SharePoint (if you do, I’m [...]]]></description>
			<content:encoded><![CDATA[<p>We often need to ensure that users enter text information in a specific way. For example, perhaps our company uses part numbers such as TL-1400 and RW-1555. Every part number begins with two letters, followed by a dash, followed by four digits. Or perhaps we use Social Security Numbers in SharePoint (if you do, I’m sure you have the appropriate security in place) and need to insure they always follow the same format of three digits, a dash, two digits, a dash, and four digits. We may want to make sure that phone numbers always follow the format of three digits, a dash, three digits, a dash, and four digits. We may want to make sure that an email address field contains some characters, an ampersand, some more characters, a dot, and some more characters (as well as doesn’t include spaces and other special characters).</p>
<p>In this post, I’m going to explain how to validate these types of information and put you on the path to validating your own text formatting in your organization. This is a great method to use when creating a Site Column for frequently used information that needs strict formatting.</p>
<p>Several people have written about how to use SharePoint Designer to modify forms to do this type of validation but that is only a solution for a single instance of usage. If you’re running Enterprise Edition, you can modify your list forms in InfoPath and do formatting validation there. However, once again, it only solves the problem for that particular list.</p>
<p>Both the SharePoint Designer and InfoPath solutions use Regular Expressions. This is a very easy way to validate information (although it’s not so easy to learn). Although SharePoint 2010 does allow Column Validation, Regular Expressions are not supported. <img style="border-bottom-style: none;border-left-style: none;border-top-style: none;border-right-style: none" class="wlEmoticon wlEmoticon-sadsmile" alt="Sad smile" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/wlEmoticon-sadsmile.png" /> However, there are lots of string functions we can use to meet our needs! <img style="border-bottom-style: none;border-left-style: none;border-top-style: none;border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/wlEmoticon-smile.png" />&#160;<a href="http://office.microsoft.com/en-us/sharepoint-foundation-help/CH010372694.aspx?CTT=97" target="_blank">Click here to access information about the formulas that are available in SharePoint 2010 and how to use them</a>.</p>
<p><strong>Validate a Social Security Number in SharePoint 2010</strong></p>
<p>Let’s begin by seeing how we might validate a Social Security Number in SharePoint 2010. I’ve created a custom list and added a column of data type <strong><em>Single line of text</em></strong> named <strong><em>SSN</em></strong>. <a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb.png" width="597" height="484" /></a></p>
<p>Our requirements are that the field must be 11 characters long—consisting of three digits, a dash, two digits, a dash, and four digits. Let’s edit the column and create a formula to check only the number of characters. We’ll use the formula <strong><em>=Len([SSN])=11</em></strong>and also set our User message we want people to see when we have everything working to, “<strong><em>Must be in the format ###-##-####!</em></strong>“    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image1.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb1.png" width="644" height="189" /></a></p>
<p>If we test this by trying to add a list item that has only 10 characters, we see our error message.   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image2.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb2.png" width="644" height="160" /></a></p>
<p>So, we have the first piece of criteria we need. We’ll remember that and work on another piece. Let’s validate that the fourth character is a dash. To do this, we’ll use the MID function like so: <strong><em>=MID([SSN],4,1=”-“)</em></strong>. <em>This tells SharePoint to extract a string out of the MIDdle of our field that is 1 character long and begins with the character in the 4th position, then check to see if it is a dash. </em>    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image3.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb3.png" width="644" height="189" /></a></p>
<p>If we try to enter any value that doesn’t have a dash as the fourth character, we see the error.   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image4.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb4.png" width="644" height="99" /></a></p>
<p>However, it accepts anything that has a dash in that position.   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image5.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb5.png" width="644" height="105" /></a>    </p>
<p>The next thing we want to do is combine these two formulas. You would think we could use the AND operator like so: =LEN([SSN])=11 AND (MID(SSN,4,1)=&quot;-&quot;). However SharePOint doesn’t like that and will tell us “The formula contains a syntax error or is not supported.” Ugh! We could use the IF function, but it creates a mess that looks like this: <strong><em>=IF(LEN([SSN])=11,(IF(MID([SSN],4,1)=&quot;-&quot;,TRUE,FALSE)),FALSE)</em></strong>. Yuch! In fact, double Yuch! If you think that’s difficult to read (not to mention write and debug) with only two pieces of criteria, wait until we have 21 pieces of criteria! That’s just not usable at all. So, is there anything else we can do? Yes there is!</p>
<p>A TRUE value equates to the number 1 while a FALSE value equates to 0. We can use this fact to create a formula that is easier to read, like so:   <br /><strong><em>=(LEN([SSN])=11)       <br />+(MID([SSN],4,1)=&quot;-&quot;)        <br />=2</em></strong></p>
<p>This tells SharePoint to take the result of the first condition, add it to the result of the second condition and see if the combined result is 2. If it is, our formula will evaluate to TRUE.<a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image6.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb6.png" width="644" height="188" /></a></p>
<p>With this formula, both pieces of criteria must be met for SharePoint to allow the entry:   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image7.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb7.png" width="644" height="114" /></a></p>
<p>Now that we have a simple way to check for multiple conditions, we can add a check for the second dash in the seventh position:   <br /><strong><em>=(LEN([SSN])=11)       <br />+(MID([SSN],4,1)=&quot;-&quot;)        <br />+(MID([SSN],7,1)=&quot;-&quot;)        <br />=3        <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image8.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb8.png" width="644" height="135" /></a></em></strong></p>
<p>The next thing we want to do is make sure that the <em>first character</em> is a digit. To do this, we’ll look at it’s ASCII value. <a href="http://www.asciitable.com/" target="_blank">Click here for a chart you can use to look up ASCII values</a>. The number 0 has an ASCII value of 48 and the number 9 has an ASCII value of 57. So we can do two checks to see if the value is greater than 47 and less than 58. We’ll use the CODE function to get the value. If we add these two tests to our function, it will look like this:    <br /><strong><em>=(LEN([SSN])=11)       <br />+(MID([SSN],4,1)=&quot;-&quot;)        <br />+(MID([SSN],7,1)=&quot;-&quot;)        <br />+(CODE(MID([SSN],1,1))&gt;47)        <br />+(CODE(MID([SSN],1,1))&lt;58)        <br />=5</em></strong></p>
<p>Now, our field must be eleven characters long, have a dash as the fourth character, have a dash as the seventh character, and must begin with a number.   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image9.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb9.png" width="644" height="163" /></a></p>
<p>Now you know everything you need to know to finish the formula to have it check for digits in the other eight positions. Here is the finished formula:   <br /><strong><em>=(LEN([SSN])=11)       <br />+(MID([SSN],4,1)=&quot;-&quot;)        <br />+(MID([SSN],7,1)=&quot;-&quot;)        <br />+(CODE(MID([SSN],1,1))&gt;47)        <br />+(CODE(MID([SSN],1,1))&lt;58)        <br />+(CODE(MID([SSN],2,1))&gt;47)        <br />+(CODE(MID([SSN],2,1))&lt;58)        <br />+(CODE(MID([SSN],3,1))&gt;47)        <br />+(CODE(MID([SSN],3,1))&lt;58)        <br />+(CODE(MID([SSN],5,1))&gt;47)        <br />+(CODE(MID([SSN],5,1))&lt;58)        <br />+(CODE(MID([SSN],5,1))&gt;47)        <br />+(CODE(MID([SSN],5,1))&lt;58)        <br />+(CODE(MID([SSN],6,1))&gt;47)        <br />+(CODE(MID([SSN],6,1))&lt;58)        <br />+(CODE(MID([SSN],6,1))&gt;47)        <br />+(CODE(MID([SSN],6,1))&lt;58)        <br />+(CODE(MID([SSN],6,1))&gt;47)        <br />+(CODE(MID([SSN],6,1))&lt;58)        <br />+(CODE(MID([SSN],6,1))&gt;47)        <br />+(CODE(MID([SSN],6,1))&lt;58)        <br />=21        <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image10.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/12/image_thumb10.png" width="644" height="192" /></a></em></strong></p>
<p><strong>Validate a Telephone Number in SharePoint 2010</strong></p>
<p>We can use these these same techniques to validate a phone number. Here is a formula to validate for ###-###-#### format:   <br /><strong><em>=(LEN([Phone])=12)       <br />+(CODE(MID([Phone],1,1))&gt;47)        <br />+(CODE(MID([Phone],1,1))&lt;58)        <br />+(CODE(MID([Phone],2,1))&gt;47)        <br />+(CODE(MID([Phone],2,1))&lt;58)        <br />+(CODE(MID([Phone],3,1))&gt;47)        <br />+(CODE(MID([Phone],3,1))&lt;58)        <br />+(MID([Phone],4,1)=&quot;-&quot;)        <br />+(CODE(MID([Phone],5,1))&gt;47)        <br />+(CODE(MID([Phone],5,1))&lt;58)        <br />+(CODE(MID([Phone],6,1))&gt;47)        <br />+(CODE(MID([Phone],6,1))&lt;58)        <br />+(CODE(MID([Phone],7,1))&gt;47)        <br />+(CODE(MID([Phone],7,1))&lt;58)        <br />+(MID([Phone],8,1)=&quot;-&quot;)        <br />+(CODE(MID([Phone],9,1))&gt;47)        <br />+(CODE(MID([Phone],9,1))&lt;58)        <br />+(CODE(MID([Phone],10,1))&gt;47)        <br />+(CODE(MID([Phone],10,1))&lt;58)        <br />+(CODE(MID([Phone],11,1))&gt;47)        <br />+(CODE(MID([Phone],11,1))&lt;58)        <br />+(CODE(MID([Phone],12,1))&gt;47)        <br />+(CODE(MID([Phone],12,1))&lt;58)        <br />=23</em></strong></p>
<p>And here is a formula to validate for (###)###-#### format:   <br /><strong><em>=(LEN([Phone])=13)       <br />+(MID([Phone],1,1)=&quot;(&quot;)        <br />+(CODE(MID([Phone],2,1))&gt;47)        <br />+(CODE(MID([Phone],2,1))&lt;58)        <br />+(CODE(MID([Phone],3,1))&gt;47)        <br />+(CODE(MID([Phone],3,1))&lt;58)        <br />+(CODE(MID([Phone],4,1))&gt;47)        <br />+(CODE(MID([Phone],4,1))&lt;58)        <br />+(MID([Phone],5,1)=&quot;)&quot;)        <br />+(CODE(MID([Phone],6,1))&gt;47)        <br />+(CODE(MID([Phone],6,1))&lt;58)        <br />+(CODE(MID([Phone],7,1))&gt;47)        <br />+(CODE(MID([Phone],7,1))&lt;58)        <br />+(CODE(MID([Phone],8,1))&gt;47)        <br />+(CODE(MID([Phone],8,1))&lt;58)        <br />+(MID([Phone],9,1)=&quot;-&quot;)        <br />+(CODE(MID([Phone],10,1))&gt;47)        <br />+(CODE(MID([Phone],10,1))&lt;58)        <br />+(CODE(MID([Phone],11,1))&gt;47)        <br />+(CODE(MID([Phone],11,1))&lt;58)        <br />+(CODE(MID([Phone],12,1))&gt;47)        <br />+(CODE(MID([Phone],12,1))&lt;58)        <br />+(CODE(MID([Phone],13,1))&gt;47)        <br />+(CODE(MID([Phone],13,1))&lt;58)        <br />=24</em></strong></p>
<p><strong>Validate a Part Number in SharePoint 2010</strong></p>
<p>In my opening paragraph I mentioned the possibility of a part number in the format of two letters, a dash, and four numbers such as TL-1400 or RW-1555. We could validate this with:   <br /><strong><em>=(LEN([PartNum])=7)       <br />+(CODE(MID([PartNum],2,1))&gt;64)        <br />+(CODE(MID([PartNum],2,1))&lt;90)        <br />+(CODE(MID([PartNum],3,1))&gt;64)        <br />+(CODE(MID([PartNum],3,1))&lt;90)        <br />+(MID([PartNum],4,1)=&quot;-&quot;)        <br />+(CODE(MID([PartNum],5,1))&gt;47)        <br />+(CODE(MID([PartNum],5,1))&lt;58)        <br />+(CODE(MID([PartNum],6,1))&gt;47)        <br />+(CODE(MID([PartNum],6,1))&lt;58)        <br />+(CODE(MID([PartNum],7,1))&gt;47)        <br />+(CODE(MID([PartNum],7,1))&lt;58)        <br />+(CODE(MID([PartNum],8,1))&gt;47)        <br />+(CODE(MID([PartNum],8,1))&lt;58)        <br />=14</em></strong></p>
<p><strong>More…</strong></p>
<p>I hope this has been helpful. Feel free to leave helpful formulas you’ve developed in the comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-strict-text-formats-in-sharepoint-2010/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Get InfoPath to display lookup column value, not ID</title>
		<link>http://sharepointsolutions.com/sharepoint-help/blog/2011/11/get-infopath-to-display-lookup-column-value-not-id/</link>
		<comments>http://sharepointsolutions.com/sharepoint-help/blog/2011/11/get-infopath-to-display-lookup-column-value-not-id/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 15:20:00 +0000</pubDate>
		<dc:creator>Kevin Pine</dc:creator>
				<category><![CDATA[InfoPath 2010]]></category>
		<category><![CDATA[SharePoint 2010 RTM]]></category>
		<category><![CDATA[Column]]></category>
		<category><![CDATA[InfoPath]]></category>
		<category><![CDATA[Lookup]]></category>
		<category><![CDATA[Values]]></category>

		<guid isPermaLink="false">http://sharepointsolutions.com/sharepoint-help/blog/2011/11/get-infopath-to-display-lookup-column-value-not-id/</guid>
		<description><![CDATA[If you have ever used a SharePoint list containing lookup columns as a data source in your InfoPath forms, you may have been disappointed to see the value of the lookup is not displayed. Instead of the value, the list ID of the item containing the value is displayed.
My ‘Construction Line Items’ list contains three [...]]]></description>
			<content:encoded><![CDATA[<p><font size="3">If you have ever used a SharePoint list containing lookup columns as a data source in your InfoPath forms, you may have been disappointed to see the value of the lookup is not displayed. Instead of the value, the list ID of the item containing the value is displayed.</font></p>
<p><font size="3">My ‘Construction Line Items’ list contains three lookup columns: Project, Category, and Product.</font></p>
<p><font size="3">When I connect to this list from InfoPath, my repeating table shows the lookup item IDs and not the values like I want.</font></p>
<p><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/11/image.png"><img style="border-right-width: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/11/image_thumb.png" width="565" height="617" /></a></p>
<p>This example uses the following four SharePoint lists: Line Items, Projects, Construction Category, Products and Activities.</p>
<p>The InfoPath form connects to the Line Items list and displays the data in a Repeating Table</p>
<p>So, how can you get InfoPath to display the lookup column value? One way is to add a data connection to the list (or lists) containing the lookup values and change the repeating table field controls from text boxes to calculated fields. Here are the steps:</p>
<ol>
<li><strong>Create data connections</strong> to the lists containing the lookup values      </p>
<p><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/11/image1.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/11/image_thumb1.png" width="549" height="402" /></a>      </p>
</li>
<li>Change the repeating table field control from Text Box to <strong>Calculated Value       <br /></strong>      <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/11/image2.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/11/image_thumb2.png" width="572" height="391" /></a>
</li>
<li><strong>Edit Formula</strong> on the calculated field control (Right-click, Calculated Value Properties or double-click, Control Properties)
<p><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/11/image3.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/11/image_thumb3.png" width="562" height="482" /></a>      </p>
</li>
<li>Delete the current formula and<strong> Insert Field or Group</strong> &gt; change the Fields source to the <strong>data connection containing the lookup value</strong> (Construction Category) &gt; <strong>select the lookup field column</strong> (Category) &gt; click <strong>Filter Data       <br /></strong>      <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/11/image4.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/11/image_thumb4.png" width="527" height="470" /></a>
</li>
<li>Set the filter where the <strong>ID</strong> (on the Construction Category) &gt; <strong>is equal to</strong> &gt; Select a field or group &gt; change fields to the <strong>Line Items</strong> data connection &gt; <strong>select the corresponding column</strong> (Category on the repeating table connection) &gt; OK
<p><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/11/image5.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/11/image_thumb5.png" width="616" height="487" /></a>      </p>
</li>
<li>Preview the form to see that the categories are now showing instead of the lookup IDs
<p><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/11/image6.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/11/image_thumb6.png" width="587" height="295" /></a>      </p>
</li>
<li>Following the same steps for the Item column allows the values to show there too instead of the lookup item IDs.
<p><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/11/image7.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/11/image_thumb7.png" width="586" height="302" /></a>      </p>
</li>
</ol>
<p>Let me know if you have another way of accomplishing the same thing.</p>
]]></content:encoded>
			<wfw:commentRss>http://sharepointsolutions.com/sharepoint-help/blog/2011/11/get-infopath-to-display-lookup-column-value-not-id/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Few Notes on SharePoint 2010 Service Pack 1 and the June Cumulative Update</title>
		<link>http://sharepointsolutions.com/sharepoint-help/blog/2011/07/a-few-notes-on-sharepoint-2010-service-pack-1-and-the-june-cumulative-update/</link>
		<comments>http://sharepointsolutions.com/sharepoint-help/blog/2011/07/a-few-notes-on-sharepoint-2010-service-pack-1-and-the-june-cumulative-update/#comments</comments>
		<pubDate>Sat, 30 Jul 2011 01:56:20 +0000</pubDate>
		<dc:creator>Ricky Spears</dc:creator>
				<category><![CDATA[For Server Administrators]]></category>
		<category><![CDATA[SharePoint 2010 RTM]]></category>
		<category><![CDATA[June 2001 CU]]></category>
		<category><![CDATA[June 2011 Cumulative Update]]></category>
		<category><![CDATA[Service Pack 1]]></category>
		<category><![CDATA[SP1]]></category>
		<category><![CDATA[Upgrade]]></category>

		<guid isPermaLink="false">http://sharepointsolutions.com/sharepoint-help/blog/2011/07/a-few-notes-on-sharepoint-2010-service-pack-1-and-the-june-cumulative-update/</guid>
		<description><![CDATA[I just finished upgrading a three-server SharePoint 2010 farm (1 Web Front End (WFE01), 1 Application Server (APP01), and a separate Database Server; almost exactly as described in Jeff’s post How to Scale Out a SharePoint 2010 Farm from Two-Tier to Three-Tier By Adding a Dedicated Application Server) to Service Pack 1 and the June [...]]]></description>
			<content:encoded><![CDATA[<p>I just finished upgrading a three-server SharePoint 2010 farm (1 Web Front End (WFE01), 1 Application Server (APP01), and a separate Database Server; almost exactly as described in <a href="http://sharepointsolutions.com/sharepoint-help/members/jeffcate/">Jeff</a>’s post <a href="http://sharepointsolutions.com/sharepoint-help/blog/2011/02/how-to-scale-out-a-sharepoint-2010-farm-from-two-tier-to-three-tier-by-adding-a-dedicated-application-server/">How to Scale Out a SharePoint 2010 Farm from Two-Tier to Three-Tier By Adding a Dedicated Application Server</a>) to Service Pack 1 and the June 2011 Cumulative Update. This isn’t going to be an exhaustive post that digs into the details of how to do this. I’m mostly just sharing a few things I either found interesting or would have liked to have known beforehand. Feel free to post your own comments below too.</p>
<h2>Backup First!</h2>
<p>Hopefully you will have the luxury of first installing the updates in an a test environment that is identical to your production environment. Unfortunately, I expect that isn’t going to be the case for most people. At least make sure that you have backups of both your databases and the servers. If you’re in a Hyper-V environment, make snapshots of the servers so you can revert if you have to.</p>
<h2>Downloads</h2>
<p>I recommend that you download EVERYTHING you’ll need before you begin installing anything. You would be in a pickle if you ended up not being able to download one of the necessary files in the middle of the process. You’ll have to request that Microsoft email you links to the Cumulative Updates—these aren’t available for public download otherwise. The CUs are executable zip files and they mostly contain only a single EXE.</p>
<h2>The Install Order</h2>
<p>Although there have been several posts both from Microsoft and other sources about the proper order to install things, there seems to be a lot of disagreement. This client was running SharePoint Server 2010 Enterprise Edition and was also running the Office Web Applications. Here are the general steps I followed and a few things I found notable.</p>
<ol>
<li><strong>Install SharePoint Foundation 2010 SP1 on WFE01. (sharepointfoundation2010sp1-kb2460058-x64-fullfile-en-us.exe)</strong> This installed quickly in about 4-minutes. No reboot was required afterward.</li>
<li><strong>Install SharePoint Foundation 2010 SP1 on APP01.</strong> Another quick installation. A reboot was required, but the Application Server is running different services than the WFE, so this was not abnormal.</li>
<li><strong>Install SharePoint Server 2010 SP1 on WFE01. (officeserver2010sp1-kb2460045-x64-fullfile-en-us.exe)</strong> Took about 15-minutes to install.</li>
<li><strong>Install SharePoint Server 2010 SP1 on APP01.</strong> Took about 15-minutes to install and a reboot was required afterward.</li>
<li><strong>Run Configuration Wizard on WFE01.</strong> This took about 15-minutes. I go an error at the end, and then realized I was not logged in as the Farm account, so I logged back in with the SP_Farm account (that’s the account I usually use for setups). The second time it completed successfully in about 3-minutes.</li>
<li><strong>Run Configuration Wizard on APP01. </strong>Ran in about 5-minutes with no problems (logged in as SP_Farm this time though).</li>
<li><strong>Install Office Web Apps SP1 on WFE01. (wacserver2010sp1-kb2460073-x64-fullfile-en-us.exe)</strong> The install requests to stop and restart the SharePoint 2010 Timer Application. I allowed this so a reboot wouldn’t be required. It took less than 3-minutes to install.</li>
<li><strong>Install Office Web Apps SP1 on APP01. </strong>Installed in about 3-minutes.</li>
<li><strong>Run Configuration Wizard on WFE01.</strong> Ran in about 3-minutes without errors.</li>
<li><strong>Run Configuration Wizard on APP01. </strong>Ran in about 3-minutes without errors.</li>
<li><strong>Install June CU for SharePoint on WFE01. (435088_intl_x64_zip.exe)</strong> Took about 17-minute to install. I found it interesting that this file was nearly 1Gb; almost three times as large as SP1!</li>
<li><strong>Install June CU for SharePoint on APP01. </strong>Took about 18-minutes to install.</li>
<li><strong>Run Configuration Wizard on WFE01. </strong>Took about 7-minutes to run and I got an error at the end. Although I wasn’t prompted to reboot, it seems that a reboot is required after installing this. The Wizard ran in about 2-minutes after this.</li>
<li><strong>Run Configuration Wizard on APP01.</strong> I learned my lesson from before and rebooted before running this. It ran in about 4-minutes with no problems.</li>
<li><strong>Install June CU for Office Web Apps on WFE01. (434726_intl_x64_zip.exe)</strong> The install requests to stop and restart the SharePoint 2010 Timer Application. I allowed this so a reboot wouldn’t be required. It took less than 3-minutes to install.</li>
<li><strong>Install June CU for Office Web Apps on APP01.</strong> Process was exactly as previous step.</li>
<li><strong>Run Configuration Wizard on WFE01. </strong>Took about 7-minutes to run and was successful.</li>
<li><strong>Run Configuration Wizard on APP01. </strong>Took about 2-minutes to run and was successful.</li>
</ol>
<p>A Coworker pointed out to me that I had overlooked installing the June 2011 Cumulative Update for SharePoint Foundation 2010. If I had to do it over, the following four steps would have been after step 10 above and before step 11.</p>
<ol>
<li><strong>Install June CU for SharePoint Foundation 2010 on WFE01. (435083_intl_x64_zip.exe)</strong> When I tried to install this, it told me, “There are no products affected by this package installed on this system.” This indicated to me that everything in the Foundation 2010 CU was actually in the Server CU. So maybe this didn’t need to be installed afterall.</li>
<li><strong>Install June CU for Office Web Apps on APP01. </strong>See previous notes—I was able to skip this.</li>
<li><strong>Run Configuration Wizard on WFE01.</strong> No need for this since I didn’t install the CU.</li>
<li><strong>Run Configuration Wizard on APP01. </strong>No need for this since I didn’t install the CU.</li>
<ol><!--EndFragment--></ol>
</ol>
<h2>Testing! Testing! Testing!</h2>
<p>Regardless of whether you’re doing this in a production environment or a testing/development environment, you’ll want to test everything you can think of such as:</p>
<ul>
<li><strong>Edit and View Word, Excel, PowerPoint, and OneNote documents in the browser.</strong></li>
<li><strong>View My Sites.</strong></li>
<li><strong>Test User Profile Synchronization.</strong> – After the updates, the User Profile Synchronization Service was stopped. I started it on the Application Server and all was well. One thing I noticed was that an incremental profile synchronization used to take 10- to 15-minutes to complete (it contained both import and export items). After the update it took less than 45-minutes.</li>
<li><strong>Tag Pages and check for tags in Newsfeed.</strong> – One of the problems the client had before the update was that Tag Profile pages didn’t display the <strong>All</strong> history (only the last sixty-days). After the update, Tag Profile pages were working properly.</li>
<li><strong>View a Visio Web Access Drawing in the Browser.</strong></li>
<li><strong>Work in an Access Web Database site.</strong></li>
<li><strong>Add an obscure word to a page or document, do an incremental search crawl, and search for the word.</strong></li>
<li><strong>Add terms and/or term sets to the Managed Metadata store.</strong></li>
<li><strong>View Reporting Services Reports (or Access Web Database Reports).</strong></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://sharepointsolutions.com/sharepoint-help/blog/2011/07/a-few-notes-on-sharepoint-2010-service-pack-1-and-the-june-cumulative-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What Replaced the Build Dynamic String Workflow Activity in SharePoint Designer 2010?</title>
		<link>http://sharepointsolutions.com/sharepoint-help/blog/2011/07/what-replaced-the-build-dynamic-string-workflow-activity-in-sharepoint-designer-2010/</link>
		<comments>http://sharepointsolutions.com/sharepoint-help/blog/2011/07/what-replaced-the-build-dynamic-string-workflow-activity-in-sharepoint-designer-2010/#comments</comments>
		<pubDate>Fri, 29 Jul 2011 18:57:56 +0000</pubDate>
		<dc:creator>Ricky Spears</dc:creator>
				<category><![CDATA[For Developers]]></category>
		<category><![CDATA[For Users]]></category>
		<category><![CDATA[SharePoint 2010 RTM]]></category>
		<category><![CDATA[SharePoint Designer 2010]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://sharepointsolutions.com/sharepoint-help/blog/2011/07/what-replaced-the-build-dynamic-string-workflow-activity-in-sharepoint-designer-2010/</guid>
		<description><![CDATA[One of the SharePoint Designer workflow activities I use most in SharePoint 2007 is Build Dynamic String. It is a very convenient way to create a customized string of dynamic text that I can then use and re-use for email subject lines, descriptions, task titles, and all sorts of things.
Unfortunately, Microsoft made the decision to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image25.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;float: right;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Build Dynamic String Action in SharePoint Designer 2007" align="right" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb25.png" width="244" height="159" /></a>One of the SharePoint Designer workflow activities I use most in SharePoint 2007 is <strong>Build Dynamic String</strong>. It is a very convenient way to create a customized string of dynamic text that I can then use and re-use for email subject lines, descriptions, task titles, and all sorts of things.</p>
<p>Unfortunately, Microsoft made the decision to disable the Build Dynamic String workflow activity in SharePoint 2010. You may have already discovered <a href="http://sharepointresourcecenter.com/build-dynamic-string-spd-workflow-activity-in-sharepoint-2010.html">Greg Osimowicz’s blog post about how to re-enable the Build Dynamic String activity in SharePoint 2010</a>. However, not only is this method neither recommended or supported by Microsoft, but if you aren’t the SharePoint Server administrator, you probably can’t edit the <strong>WSS.Actions</strong> file anyway. So, how can YOU, as a workflow designer, Build a Dynamic String in a workflow in SharePoint Designer 2010?</p>
<p><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image26.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;float: right;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Utility Actions in SharePoint Designer 2010" align="right" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb26.png" width="244" height="124" /></a>In SharePoint 2010, Microsoft has replaced the Build Dynamic String activity with four new Utility Actions to Extract Substrings. While all of them are useful, only one of them properly replicates the Build Dynamic String activity from SharePoint 2007: <strong>Extract Substring from Index of String</strong>. In this post I’ll explain how to use this and then explain why the other three don’t properly duplicate the Build Dynamic String function.</p>
<h2>How to Use Extract Substring from Index of String Workflow Activity</h2>
<p>When you add the <strong>Extract Substring from Index of String</strong> activity to your workflow, it will look like this:    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image27.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Extract Substring from Index of String " src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb27.png" width="613" height="97" /></a></p>
<p>You’ll notice that there are three parameters you can edit: the original string, the starting character, and a variable to store the result. If you change the starting character from <strong><em>0</em></strong> to <strong><em>1</em></strong>, this activity will work exactly like the Build Dynamic String activity did in SharePoint Designer 2007. Here, you can see how the parameters line up:    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image28.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Comparing Build Dynamic String to Extract Substring from Index of String " src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb28.png" width="569" height="196" /></a></p>
<p>When you click on <strong><em>string</em></strong>, you will have the option of clicking on an ellipses button <strong><em>[…]</em></strong> to <strong>Display builder for this parameter,</strong> or the <strong><em>[fx]</em></strong> button to <strong>Define workflow lookup</strong>. If you click on the ellipses, you will see the String Builder window just like you were used to in SharePoint 2007. Use this window to build your dynamic string as you want it. Then change the Output Variable to a variable of your choosing. <strong>That’s all there is to it! </strong>This     <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image29.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Click on the Ellipses to launch the string builder" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb29.png" width="623" height="124" /></a></p>
<p><strong>Something to Be Aware of</strong> – In order for this to work, you <strong>must</strong> change the <strong><em>starting at</em></strong> value to <strong><em>1</em></strong>. If you leave it at <strong><em>0</em></strong>, you will end up with an empty string. If you use a value greater than <strong><em>1</em></strong> your final string will be missing characters at the beginning.</p>
<h2>Why the Other Three Extract Substring Activities Won’t Replicate Build Dynamic String</h2>
<p>The other three Utility Actions are: <strong>Extract Substring from End of String</strong>, <strong>Extract Substring from Start of String</strong>, and <strong>Extract Substring of String from Index with Length<em>. </em></strong>You can see these three activities and their parameters in the screenshot here (in the order I listed them):    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image30.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Utility Activities for: Extract Substring from End of String, Extract Substring from Start of String, and Extract Substring of String from Index with Length" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb30.png" width="614" height="161" /></a>    </p>
<p>You’ll notice that each one has a variable for the number of characters. If you leave this at <strong><em>0</em></strong>, your variable will contain an empty string. Also, <strong>if you enter a number that is greater than the length of your string, it will contain an empty string!</strong> So, these activities are only useful if you know the <em>exact</em> length your output string needs to be; this is very unlikely if you are building a dynamic string (it is dynamic, remember). These actions will only return a value if the number of characters parameter is less than or equal to the length of the string parameter.</p>
<p>So, there you have it. I hope you find this useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://sharepointsolutions.com/sharepoint-help/blog/2011/07/what-replaced-the-build-dynamic-string-workflow-activity-in-sharepoint-designer-2010/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Show the Fax Number in People Search Results in SharePoint 2010</title>
		<link>http://sharepointsolutions.com/sharepoint-help/blog/2011/07/how-to-show-the-fax-number-in-people-search-results-in-sharepoint-2010/</link>
		<comments>http://sharepointsolutions.com/sharepoint-help/blog/2011/07/how-to-show-the-fax-number-in-people-search-results-in-sharepoint-2010/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 15:42:52 +0000</pubDate>
		<dc:creator>Ricky Spears</dc:creator>
				<category><![CDATA[For Developers]]></category>
		<category><![CDATA[For Server Administrators]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[SharePoint 2010 RTM]]></category>

		<guid isPermaLink="false">http://sharepointsolutions.com/sharepoint-help/?p=927</guid>
		<description><![CDATA[I was recently working with a client who needed to show employees’ fax numbers in their People Search results in SharePoint 2010. Several months ago I got this working for them in SharePoint 2007, but it had to be configured all over again after the upgrade to SharePoint 2010. It was also more involved to [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently working with a client who needed to show employees’ fax numbers in their People Search results in SharePoint 2010. Several months ago I got this working for them in SharePoint 2007, but it had to be configured all over again after the upgrade to SharePoint 2010. It was also more involved to set up in SharePoint 2010. I didn’t see where anyone else had documented how to show other fields in People Search results, so I thought I would share how I did this here.</p>
<h2>Add Fax Numbers to User Profiles</h2>
<p>Before you can expose any information, there must be information to expose. So edit your own profile (or a test user’s profile) to ensure it contains the information you want to see. In the screenshot here, you’ll notice that Connie Watson has edited her profile to contain her Fax number.    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image2.png"><img style="border-right-width: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px;padding-top: 0px" border="0" alt="Screenshot of User Profile showing Fax number" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb2.png" width="644" height="298" /></a></p>
<h2>Configure the Fax Field to be Indexed </h2>
<p>It’s possible that the field you want to add is already being indexed, but you’ll probably need to tell SharePoint to index the new field. Log into Central Administration. Click on <strong><em>Application Management &gt; Manage Service Applications &gt; User Profile Service Application</em></strong>. On the Manage Profile Service page, click on <strong><em>Manage User Properties</em></strong>.    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image3.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Link to Manage User Profiles" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb3.png" width="575" height="108" /></a></p>
<p>In the list of Profile Properties, scroll down to find the field you want to add. You’ll find the Fax number field in the Contact Information section. Hover your mouse over it and select <strong><em>Edit </em></strong>from the drop-down menu.</p>
<p><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image4.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Edit Fax Number Profile Property Properties" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb4.png" width="644" height="258" /></a></p>
<p>On the Edit User Profile Property page, make a note of the actual name of the field and the data type in the <strong>Property Settings</strong> section. You’ll need to remember this for later steps. Here you’ll notice that the Fax number field has a Name of “Fax” and the Type is “string (Single Value)”.    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image5.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Property Settings. Notice Name and Type." src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb5.png" width="609" height="214" /></a>    </p>
<p>Scroll down to the <strong>Search Settings</strong> section. Check the box beside <strong><em>Indexed</em></strong>. If this isn’t checked, the field won’t be crawled and it won’t be available to the People Search Results web part. When you are done, scroll to the bottom and click the <strong><em>OK</em></strong> button.    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image6.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Profile Property Search Settings: Indexed Checked" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb6.png" width="504" height="138" /></a></p>
<h2>Add the Fax Fields to the Metadata Properties to be Searched</h2>
<p>Although you’ve told the User Profile Service that this field is to be indexed, you still have to tell the Search Service to index it.</p>
<p>In Central Administration click on <strong><em>Application Management &gt; Manage Service Applications &gt; Search Service Application</em></strong>. On the Search Administration page, look in the left-hand navigation, scroll down to the <strong>Queries and Results</strong> section, and click on <strong><em>Metadata Properties</em></strong>.</p>
<p><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image7.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="In the Search Service Application, Click on Metadata Properties" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb7.png" width="372" height="479" /></a></p>
<p>Scroll through the pages of properties and look carefully to make sure that the field you want to add isn’t already listed. The Fax field isn’t listed by default. On the Metadata Property Mappings page, click on <strong><em>New Managed Property</em></strong>.    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image8.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Add a New Managed Property" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb8.png" width="644" height="137" /></a>    </p>
<p>On the New Managed Property page, enter a name for the field. I named it “Fax” to be consistent. Enter a description if you want and select the appropriate data type. I selected <strong><em>Text</em></strong> since the Fax number data type I made note of on the <strong>Property Settings page</strong> “string (single value)”. Because the data type was a “single value” I left the box <em>unchecked</em> her for “Has Multiple Values.”    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image9.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="New Managed Property settings: Property Name and type" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb9.png" width="390" height="269" /></a></p>
<p>In the Mappings to Crawled Properties section, click on the <em><strong>Add Mapping</strong><u> button.       <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image10.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Add Mapping to Managed Metadata Property" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb10.png" width="644" height="198" /></a></u></em></p>
<p>In the <strong>Crawled Property Selection</strong> dialog, type “Fax” for the Crawled property name and click the <strong><em>Find</em></strong> button. You’ll notice there are three properties that are shown. I added all three of them. You’ll have to add them one at a time though. So, select one of them, then click <strong><em>OK</em></strong>, then click the <strong><em>Add Mapping </em></strong>button again and repeat the process until you’ve added all three of them.    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image11.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Adding the Crawled Properties" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb11.png" width="602" height="544" /></a></p>
<p>You should see all three Fax properties listed. Scroll to the bottom of the page and click the <strong><em>OK</em></strong> button.    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image12.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="The properties to be crawled have been added" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb12.png" width="644" height="145" /></a></p>
<h2>Start a Full Search Crawl</h2>
<p>Navigate back to the page where you manage the Search Service Application. In the left hand navigation, in the <strong>Crawling</strong> section, click <strong><em>Content Sources</em></strong>. Hover your mouse over the content source that contains the User Profile information (it’s probably named “Local SharePoint sites,” and select <strong><em>Start Full Crawl.       <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image13.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Start a full crawl" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb13.png" width="608" height="346" /></a></em></strong></p>
<h2>Add the Fax Column to the People Search Core Results Web Part</h2>
<p>Navigate to the Search Center site and perform a People Search. When you see the people search results page (peopleresults.aspx), click on <strong><em>Site Actions –&gt; Edit Page</em></strong>. Locate the <strong>People Search Core Results</strong> web part and click <strong><em>Edit Web Part</em></strong>.</p>
<p><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image14.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Edit the People Search Core Results Web Part" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb14.png" width="644" height="313" /></a></p>
<p>In the <strong>Tool Pane</strong>, expand the <strong>Display Properties</strong> section and <em>uncheck</em> the box to <strong><em>Use Location Visualization</em></strong>. This will enable the <strong>Fetched Properties</strong> field,<strong> XSL Editor</strong> button, and <strong>Parameters Editor</strong> buttons (<em>these options will be greyed-out and therefore unavailable until you uncheck this box</em>).</p>
<p><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image15.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Uncheck the Use Location Visualaztion box to enable Fetched Properties , XSL Editor, and Paramenters Editor" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb15.png" width="220" height="484" /></a></p>
<p>Click in the <strong><em>Fetched Properties</em></strong> text box, press <strong><em>CTRL-A</em></strong> on your keyboard, then press <strong><em>CTRL-C</em></strong> to copy all the text to your clipboard. Open Notepad (or your favorite text editor) and paste in the text you copied. Locate the information for the <strong>WorkEmail</strong>, copy this section.</p>
<p><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image16.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="&lt;Columns&gt;  &lt;Column Name=&quot;WorkId&quot;/&gt;  &lt;Column Name=&quot;UserProfile_GUID&quot;/&gt;  &lt;Column Name=&quot;AccountName&quot;/&gt;  &lt;Column Name=&quot;PreferredName&quot; HitHighLight=&quot;true&quot;/&gt;  &lt;Column Name=&quot;YomiDisplayName&quot; HitHighLight=&quot;true&quot;/&gt;  &lt;Column Name=&quot;JobTitle&quot; HitHighLight=&quot;true&quot;/&gt;  &lt;Column Name=&quot;Department&quot; HitHighLight=&quot;true&quot;/&gt;  &lt;Column Name=&quot;WorkPhone&quot; HitHighLight=&quot;true&quot;/&gt;  &lt;Column Name=&quot;OfficeNumber&quot; HitHighLight=&quot;true&quot;/&gt;  &lt;Column Name=&quot;PictureURL&quot;/&gt;  &lt;Column Name=&quot;HierarchyUrl&quot;/&gt;  &lt;Column Name=&quot;WorkEmail&quot; HitHighLight=&quot;true&quot;/&gt;  &lt;Column Name=&quot;Path&quot;/&gt;  &lt;Column Name=&quot;HitHighlightedSummary&quot;/&gt;  &lt;Column Name=&quot;HitHighlightedProperties&quot;/&gt;  &lt;Column Name=&quot;Responsibility&quot; HitHighLight=&quot;true&quot;/&gt;  &lt;Column Name=&quot;Skills&quot; HitHighLight=&quot;true&quot;/&gt;  &lt;Column Name=&quot;SipAddress&quot; HitHighLight=&quot;true&quot;/&gt;  &lt;Column Name=&quot;Schools&quot; HitHighLight=&quot;true&quot;/&gt;  &lt;Column Name=&quot;PastProjects&quot; HitHighLight=&quot;true&quot;/&gt;  &lt;Column Name=&quot;Interests&quot; HitHighLight=&quot;true&quot;/&gt;   &lt;Column Name=&quot;OrgNames&quot; HitHighLight=&quot;true&quot;/&gt;  &lt;Column Name=&quot;OrgUrls&quot;/&gt;  &lt;Column Name=&quot;OrgParentNames&quot; HitHighLight=&quot;true&quot;/&gt;  &lt;Column Name=&quot;OrgParentUrls&quot;/&gt;  &lt;Column Name=&quot;Memberships&quot; HitHighLight=&quot;true&quot;/&gt;  &lt;Column Name=&quot;AboutMe&quot; HitHighLight=&quot;true&quot;/&gt;  &lt;Column Name=&quot;BaseOfficeLocation&quot; HitHighLight=&quot;true&quot;/&gt;  &lt;Column Name=&quot;ServiceApplicationID&quot;/&gt;  &lt;Column Name=&quot;SocialDistance&quot;/&gt;&lt;/Columns&gt;" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb16.png" width="644" height="262" /></a></p>
<p>Paste this section back right after the place where you copied it. After you’ve pasted in that section, change <strong><em>WorkEmail</em></strong> in what you pasted to <strong><em>Fax</em></strong> (or the name of the field you want to add). It is very important that everything stays on one line so <strong><em>be careful not to insert any line breaks</em></strong> when you do this. <a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image17.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Editing Fetched Properties" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb17.png" width="644" height="263" /></a></p>
<p>After you’ve changed the name of the field you want to add, copy all the text again and paste it back into the Fetched Properties field of the People Search Core Results web part. After you click in the Fetched Properties field, be sure to do a CTRL-A to select all the text that is there before you past in your text or else you will have invalid markup in the box. Scroll to the bottom of the Tool Pan and click the <strong><em>Apply</em></strong> button.</p>
<p><em><strong>Caution:</strong> After editing the Fetched Properties field, you may see an error that says <strong>“Property doesn&#8217;t exist or is used in a manner inconsistent with schema settings.” </strong></em></p>
<p><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image18.png"><em><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Error in People Search Core Results Web Part: Property doesn&#39;t exist or is used in a manner inconsistent with schema settings. " src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb18.png" width="644" height="190" /></em></a><em>If you see this error, it’s probably because you skipped at least one of the previous steps to add the information you want to see to the profile of at least one user, set the column to be indexed, added the column as a searched Metadata Property, and performed a full search crawl after doing <strong>all three </strong>of those. It is also possible that the full search crawl has not yet finished. Go back and check that the work you did there was saved properly and that the full crawl has <strong>finished</strong>. If all these have been done the error should go away.      <br /></em></p>
<h2>Edit the XSLT to display the Fax Number</h2>
<p>Whew! You’re in the home stretch now! Just one more thing to do… actually show the fax number to the users. You should still have the Tool Pane open to edit the properties of the People Search Core Results web part. In the <strong>Display Properties</strong> section, click on the <strong><em>XSL Editor</em></strong> button.     <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image19.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Click on XSL Editor" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb19.png" width="233" height="176" /></a></p>
<p>You’ll need to make a few changes to the XSL code. I find it easier to copy all the XSL code from the browser dialog Text Editor and paste it into Notepad or some other editor. I also think it’s a good idea to copy the existing XSL code to another text file and save it so you’ll have a backup you can quickly paste back in here to restore it to the default in case you really mess something up—not that you would ever do that, of course.</p>
<p>Because I want the Fax number to appear below the user’s office number, I used the Find feature of Notepad to find the sections that referenced “workphone” and then duplicated those references and changed workphone to fax as needed.</p>
<p>About a third of the way down, you’ll see a section of variables that begin with “has”. This is used by the XSL to indicate if a property exists or not (a particular profile <strong>has</strong> a work phone or <strong>has</strong> a fax,.. get it?). Copy the line for the haswph variable and paste the copy on the next line. Edit the line in two places to change the workphone (wph) field to fax.    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image20.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Adding the hasfax variable in the XSL" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb20.png" width="644" height="132" /></a></p>
<p>About half way down, you’ll see a section with several xsl:if statements that test for the $has variables. One of those is for the “workphone” field. Copy these four lines and paste a copy of them below where you copied them from. Change the references to “wph” and “workphone” to reference “fax” instead.   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image21.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Adding lines to the XSL to display the Fax number" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb21.png" width="644" height="273" /></a></p>
<p>When you’re done, paste all the XSL code back into the browser dialog text editor and click the <strong><em>Save</em></strong> button. In the Tool Pane, click the <strong><em>OK </em></strong>button to save the changes to the web part and close the tool pane. On the <strong>Page</strong> ribbon, click the <strong><em>Save &amp; Close</em></strong> button to save the changes to the page.</p>
<p>Perform a people search for a person who has a fax number and notice that the fax number now appears in the results. You did it!   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image22.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Search results showing both work number and fax number" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb22.png" width="389" height="154" /></a></p>
<h2>Add Labels Beside the Properties</h2>
<p>Although the Fax number is now showing up, it’s not very obvious that one number is a fax number and the other is a phone number. It would help if there were labels to indicate which number is which. This is easy to add though.</p>
<p>Once again, click on <strong><em>Site Actions –&gt; Edit Page</em></strong>. Locate the <strong>People Search Core Results</strong> web part and click on <strong><em>Edit Web Part</em></strong>. In the Display Properties section of the Tool pane, click on the <strong><em>XSL Editor</em></strong> button.</p>
<p>Locate the <strong><em>xsl:if</em></strong> sections that display the Work Phone and Fax numbers. After the ‘li’ element and before the ‘xsl:apply-templates’ element, add the markup you want to use for a label. I used <strong><em>&lt;strong&gt;Fax: &lt;/strong&gt;</em></strong> as shown in the screenshot here.    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image23.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Modifying XSL to show labels for Phone and Fax" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb23.png" width="644" height="161" /></a></p>
<p>When you’re done, paste all the XSL code back into the browser dialog text editor and click the <strong><em>Save</em></strong> button. In the Tool Pane, click the <strong><em>OK </em></strong>button to save the changes to the web part and close the tool pane. On the <strong>Page</strong> ribbon, click the <strong><em>Save &amp; Close</em></strong> button to save the changes to the page.</p>
<p>Perform a people search for a person who has a fax number and notice that labels now appear before both the Phone number and the Fax number.   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image24.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="Search results showing both work number and fax number with labels" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb24.png" width="409" height="346" /></a></p>
<p>Now go take a break and celebrate! You’ve earned it!</p>
]]></content:encoded>
			<wfw:commentRss>http://sharepointsolutions.com/sharepoint-help/blog/2011/07/how-to-show-the-fax-number-in-people-search-results-in-sharepoint-2010/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Open the Document Information Panel in Microsoft Word 2010</title>
		<link>http://sharepointsolutions.com/sharepoint-help/blog/2011/07/how-to-open-the-document-information-panel-in-microsoft-word-2010/</link>
		<comments>http://sharepointsolutions.com/sharepoint-help/blog/2011/07/how-to-open-the-document-information-panel-in-microsoft-word-2010/#comments</comments>
		<pubDate>Sun, 03 Jul 2011 01:52:19 +0000</pubDate>
		<dc:creator>Ricky Spears</dc:creator>
				<category><![CDATA[For Users]]></category>
		<category><![CDATA[SharePoint 2010 RTM]]></category>
		<category><![CDATA[Close]]></category>
		<category><![CDATA[DIP]]></category>
		<category><![CDATA[Document Information Panel]]></category>
		<category><![CDATA[Hide]]></category>
		<category><![CDATA[Microsoft Word 2010]]></category>
		<category><![CDATA[Open]]></category>
		<category><![CDATA[Show]]></category>

		<guid isPermaLink="false">http://sharepointsolutions.com/sharepoint-help/blog/2011/07/how-to-open-the-document-information-panel-in-microsoft-word-2010/</guid>
		<description><![CDATA[One of the most convenient ways to enter or edit the metadata for a Word document is to use the Document Information Panel (DIP). It’s also very easy for a user to accidentally (or sometimes on purpose) to hide the Document Information Panel. To close the Documents Information Panel, simply click on the “X” to [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most convenient ways to enter or edit the metadata for a Word document is to use the Document Information Panel (DIP). It’s also very easy for a user to accidentally (or sometimes on purpose) to hide the Document Information Panel. To close the Documents Information Panel, simply click on the “<strong><em>X</em></strong>” to close it as shown here.</p>
<p><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb.png" width="644" height="453" /></a></p>
<p>Unfortunately, once the DIP has been closed, it’s not so obvious how to show the DIP again. However, it’s not difficult to open the DIP either. Simply click on <strong><em>File &gt; Info &gt; Properties &gt; Show Document Panel</em></strong>. </p>
<p><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image1.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/07/image_thumb1.png" width="644" height="453" /></a></p>
<p>There you have it, 4 simple clicks to show the Document Information Panel in Word 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://sharepointsolutions.com/sharepoint-help/blog/2011/07/how-to-open-the-document-information-panel-in-microsoft-word-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Add and Subtract Hours and Minutes from Date and Time Fields in SharePoint Lists</title>
		<link>http://sharepointsolutions.com/sharepoint-help/blog/2011/04/how-to-add-and-subtract-hours-and-minutes-from-date-and-time-fields-in-sharepoint-lists/</link>
		<comments>http://sharepointsolutions.com/sharepoint-help/blog/2011/04/how-to-add-and-subtract-hours-and-minutes-from-date-and-time-fields-in-sharepoint-lists/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 22:56:48 +0000</pubDate>
		<dc:creator>Ricky Spears</dc:creator>
				<category><![CDATA[For Users]]></category>
		<category><![CDATA[MOSS Help]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://sharepointsolutions.com/sharepoint-help/?p=873</guid>
		<description><![CDATA[I recently needed to write a SharePoint Designer workflow to send a reminder email 12-hours before the end of a multiple-day event. It’s easy to use the Pause Until Date activity to pause until the necessary time, but it’s not so obvious how to calculate the date and time ithe workflow needs to pause until.
The [...]]]></description>
			<content:encoded><![CDATA[<p>I recently needed to write a SharePoint Designer workflow to send a reminder email 12-hours before the end of a multiple-day event. It’s easy to use the Pause Until Date activity to pause until the necessary time, but it’s not so obvious how to calculate the date and time ithe workflow needs to pause until.</p>
<p>The easiest way to calculate the Pause Until date and time was to create it as a calculated column in SharePoint. <em>Note: although the screenshots in this post are from SharePoint 2010, the principles are the same in SharePoint 2007.</em></p>
<p>In the <strong>Name and Type</strong> section, for the name of the column name I used <strong><em>DateTime for PauseUntil</em></strong>. I selected the <strong><em>Calculated (calculation based on other columns)</em></strong> data type.    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/04/image.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/04/image_thumb.png" width="329" height="352" /></a></p>
<p>In the <strong>Additional Column Settings</strong> section, I temporarily entered a formula of <strong><em>=[End Time]-1</em></strong>, selected <strong><em>Date and Time</em></strong> as the data type, and selected <strong><em>Date &amp; Time</em> </strong>as the format.    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/04/image1.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/04/image_thumb1.png" width="409" height="418" /></a></p>
<p>You’ll notice in the screenshot here that there are three different End Times and the calculated column subtracts exactly 24 hours for the <strong><em>=[End Time] –1</em></strong> formula.    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/04/image2.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/04/image_thumb2.png" width="770" height="119" /></a></p>
<p>If we divide 1 day by 24 hours and divide 24 hours by 60 minutes, we get 1/24/60 = 0.00069444444. So, if you change the formula to <strong><em>=[End Time]-1/24/60</em></strong>…    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/04/image3.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/04/image_thumb3.png" width="240" height="48" /></a>    <br />you’ll notice that the dates and times in the <strong>Date for PauseUntil</strong> column are <em>exactly one minute</em> before the dates and times in the <strong>End Time</strong> column.    <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/04/image4.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/04/image_thumb4.png" width="358" height="118" /></a>    </p>
<p>What this means, is that to add or subtract a certain number of minutes from a date and time field, we just need to multiply 1/24/60 by the number of minutes we want to add or subtract. In my problem, I needed to subtract 12 hours which is 12*60 or 720 minutes. Let’s see if that works…   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/04/image5.png"><img style="border-bottom: 0px;border-left: 0px;margin: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/04/image_thumb5.png" width="242" height="49" /></a></p>
<p>Yep, all the calculated times are exactly twelve hours before the end time; and if you’re wondering, crossing midnight times doesn’t cause any problems for these calculations.   <br /><a href="http://sharepointsolutions.com/sharepoint-help/files/2011/04/image6.png"><img style="border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px" border="0" alt="image" src="http://sharepointsolutions.com/sharepoint-help/files/2011/04/image_thumb6.png" width="348" height="111" /></a></p>
<p>So, if you need to add or subtract a certain number of hours or minutes in a calculated column in SharePoint, you can simply <strong>multiply 1/24/60 by the number of minutes you need to add or subtract</strong> to achieve any value you need.</p>
<p><em>Special thanks goes to Mike Smith for his response in <a href="http://social.msdn.microsoft.com/Forums/en/sharepointcustomization/thread/2c0f8d0d-dec2-4d32-b186-2d4f94627732">this discussion board thread</a> for originally sharing this tip. I wrote this post in an attempt to break it down a little bit more and add screenshots in hopes that some others might find the information a little more understandable.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://sharepointsolutions.com/sharepoint-help/blog/2011/04/how-to-add-and-subtract-hours-and-minutes-from-date-and-time-fields-in-sharepoint-lists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

