{"id":24,"date":"2015-01-26T18:41:29","date_gmt":"2015-01-26T18:41:29","guid":{"rendered":"http:\/\/www.ccrossan.com\/?p=24"},"modified":"2016-07-07T08:05:12","modified_gmt":"2016-07-07T12:05:12","slug":"collecting-user-data-in-sharepoint-2010-with-custom-site-columns","status":"publish","type":"post","link":"https:\/\/crossan007.dev\/blog\/microsoft-sharepoint\/collecting-user-data-in-sharepoint-2010-with-custom-site-columns\/","title":{"rendered":"Collecting User Data in SharePoint 2010 with custom Site Columns"},"content":{"rendered":"\n<div class=\"twitter-share\"><a href=\"https:\/\/twitter.com\/intent\/tweet?via=crossan007\" class=\"twitter-share-button\">Tweet<\/a><\/div>\n<p>The Task: Build a system to archive paper documents (being scanned from e-mail enabled scanners) and optimize for retrieval<\/p>\n<p>I decided to build an E-Mail enabled library to get the documents into SharePoint. \u00a0 This allows users to save the email address in their contact list on the copier, and makes scanning in documents very easy.<\/p>\n<p>To gather the metadata for these documents, I used the &#8220;Collect \u00a0Data From a User&#8221; (CUD) Action in SharePoint Designer. \u00a0This created a Content Type based on the name of the task &#8211; In my case &#8220;Student Document Data Collection.&#8221;<\/p>\n<p>I then added some of my existing site columns to this content type from SPD &#8211; things like first name, last name, and district. \u00a0I didn&#8217;t want to use the CUD wizard to add these fields to the data collection task because a) all of the fields already exist in the site, and b) some of the fields are multiple choice, and I really don&#8217;t want to manage two instances of the same data!<\/p>\n<p>After I modified the content type, I refreshed the workflow and returned to the CUD wizard in SPD, and saw that all of my fields populated! Hoorah!<\/p>\n<p>I proceeded to build the rest of the workflow, referencing the fields collected in the CUD task in the normal manner; however, I was noticing a problem: None of the user entered data was showing up!<\/p>\n<p>How could this be? SharePoint was prompting me for the data, I entered it, and I hit save&#8230; It should be there, right? \u00a0I wrote entries to the workflow history log to see if maybe the data just wasn&#8217;t being applied to the current item. \u00a0No dice &#8211; It looked like SharePoint just wasn&#8217;t storing the collected data.<\/p>\n<p>Thanks to reddit user sbrick89, It looks like fields (Site Columns) created in the CUD action within SPD actually have a distinction from standard Site Columns! It&#8217;s not a big difference, but it will mess up your day (or, in my case WEEK)! \u00a0 These fields are prefixed with &#8220;FieldName_&#8221;.<\/p>\n<p>I jumped into my SharePoint Management PowerShell and whipped this up in order to create my Site Columns (in a way that they will be usable for data collection):<\/p>\n<p>$SiteURL = &#8220;&lt;YOUR SITE HERE&gt;&#8221;<\/p>\n<p>$Web = Get-SPWeb $SiteURL<br \/>\n$FieldXMLString = &#8216;&lt;Field Type=&#8221;Text&#8221;<br \/>\nName=&#8221;FieldName_StudentFirstName&#8221;<br \/>\nDescription=&#8221;Student First Name&#8221;<br \/>\nDisplayName=&#8221;Student First Name&#8221;<br \/>\nGroup=&#8221;0 Student Columns&#8221;<br \/>\nHidden=&#8221;FALSE&#8221;<br \/>\nRequired=&#8221;FALSE&#8221;<br \/>\nSealed=&#8221;FALSE&#8221;<br \/>\nShowInDisplayForm=&#8221;TRUE&#8221;<br \/>\nShowInEditForm=&#8221;TRUE&#8221;<br \/>\nShowInListSettings=&#8221;TRUE&#8221;<br \/>\nShowInNewForm=&#8221;TRUE&#8221;&gt;&lt;\/Field&gt;&#8217;<br \/>\n$Web.Fields.AddFieldAsXML($fieldXMLString)<\/p>\n<p>Documentation for the syntax of the $FieldXMLString can be found here:\u00a0<a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/office\/ms437580(v=office.15).aspx\" target=\"_blank\">https:\/\/msdn.microsoft.com\/en-us\/library\/office\/ms437580(v=office.15).aspx<\/a><\/p>\n<p>Of note is this\u00a0&#8220;Name:\u00a0Required Text: The name of a field. This is the <span style=\"text-decoration: underline;\"><em><strong>internal name<\/strong><\/em><\/span> of a field and is guaranteed never to change for the lifetime of the field definition. It must be unique with respect to the set of fields in a list. The name is autogenerated based on the user-defined name for a field.<\/p>\n<p>I also wanted to create a multiple choice Site Column for District:<\/p>\n<p>$FieldXMLString = &#8216;&lt;Field Type=&#8221;Choice&#8221;<br \/>\nName=&#8221;FieldName_District&#8221;<br \/>\nDescription=&#8221;District&#8221;<br \/>\nDisplayName=&#8221;District&#8221;<br \/>\nGroup=&#8221;0 Student Columns&#8221;<br \/>\nHidden=&#8221;FALSE&#8221;<br \/>\nRequired=&#8221;FALSE&#8221;<br \/>\nSealed=&#8221;FALSE&#8221;<br \/>\nShowInDisplayForm=&#8221;TRUE&#8221;<br \/>\nShowInEditForm=&#8221;TRUE&#8221;<br \/>\nShowInListSettings=&#8221;TRUE&#8221;<br \/>\nShowInNewForm=&#8221;TRUE&#8221;&gt;<br \/>\n&lt;CHOICES&gt;<br \/>\n&lt;Choice&gt;District 1&lt;\/Choice&gt;<br \/>\n&lt;Choice&gt;District 2&lt;\/Choice&gt;<br \/>\n&lt;\/CHOICES&gt;<br \/>\n&lt;\/Field&gt;&#8217;<br \/>\n$Web.Fields.AddFieldAsXML($fieldXMLString)<\/p>\n<p>After creating the Site Columns with the proper internal name, I was able to add the newly created site column to the CUD Content Type, update my workflow, and collect the user data successfully! \u00a0 Yes, It does seem that any alterations (including changes to the items in a choice Site Colume) to the CUD Content Type require that the workflow be loaded in SPD, the CUD Step opened, &#8220;next through&#8221; the wizard, and the workflow re-published in order for the changes to appear in the actual data collection step.<\/p>\n<p>Links:<\/p>\n<p><a href=\"http:\/\/www.sbrickey.com\/Tech\/Blog\/Post\/Secrets_Revealed-_SharePoint_Designer_-_Workflows_-_Approval_Task_-_Task_Form_Fields\" target=\"_blank\">http:\/\/www.sbrickey.com\/Tech\/Blog\/Post\/Secrets_Revealed-_SharePoint_Designer_-_Workflows_-_Approval_Task_-_Task_Form_Fields<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Task: Build a system to archive paper documents (being scanned from e-mail enabled scanners) and optimize for retrieval I decided to build an E-Mail enabled library to get the documents into SharePoint. \u00a0 This allows users to save the email address in their contact list on the copier, and makes scanning in documents very &hellip; <a href=\"https:\/\/crossan007.dev\/blog\/microsoft-sharepoint\/collecting-user-data-in-sharepoint-2010-with-custom-site-columns\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Collecting User Data in SharePoint 2010 with custom Site Columns<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":33,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14],"tags":[13,12,47,10,169,16,15],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/crossan007.dev\/blog\/microsoft-sharepoint\/collecting-user-data-in-sharepoint-2010-with-custom-site-columns\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Collecting User Data in SharePoint 2010 with custom Site Columns - Charles&#039; Blog\" \/>\n<meta property=\"og:description\" content=\"The Task: Build a system to archive paper documents (being scanned from e-mail enabled scanners) and optimize for retrieval I decided to build an E-Mail enabled library to get the documents into SharePoint. \u00a0 This allows users to save the email address in their contact list on the copier, and makes scanning in documents very &hellip; Continue reading Collecting User Data in SharePoint 2010 with custom Site Columns &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/crossan007.dev\/blog\/microsoft-sharepoint\/collecting-user-data-in-sharepoint-2010-with-custom-site-columns\/\" \/>\n<meta property=\"og:site_name\" content=\"Charles&#039; Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-01-26T18:41:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-07-07T12:05:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/crossan007.dev\/blog\/wp-content\/uploads\/2015\/01\/Untitled.png\" \/>\n\t<meta property=\"og:image:width\" content=\"35\" \/>\n\t<meta property=\"og:image:height\" content=\"37\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"crossan007\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/crossan007.dev\/blog\/#website\",\"url\":\"https:\/\/crossan007.dev\/blog\/\",\"name\":\"Charles&#039; Blog\",\"description\":\"SharePoint | PowerShell | Exchange | SCCM | Ubuntu | PHP | JavaScript | A\/V Live Production | More...\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/crossan007.dev\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/crossan007.dev\/blog\/microsoft-sharepoint\/collecting-user-data-in-sharepoint-2010-with-custom-site-columns\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/crossan007.dev\/blog\/wp-content\/uploads\/2015\/01\/Untitled.png\",\"contentUrl\":\"https:\/\/crossan007.dev\/blog\/wp-content\/uploads\/2015\/01\/Untitled.png\",\"width\":35,\"height\":37},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/crossan007.dev\/blog\/microsoft-sharepoint\/collecting-user-data-in-sharepoint-2010-with-custom-site-columns\/#webpage\",\"url\":\"https:\/\/crossan007.dev\/blog\/microsoft-sharepoint\/collecting-user-data-in-sharepoint-2010-with-custom-site-columns\/\",\"name\":\"Collecting User Data in SharePoint 2010 with custom Site Columns - Charles&#039; Blog\",\"isPartOf\":{\"@id\":\"https:\/\/crossan007.dev\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/crossan007.dev\/blog\/microsoft-sharepoint\/collecting-user-data-in-sharepoint-2010-with-custom-site-columns\/#primaryimage\"},\"datePublished\":\"2015-01-26T18:41:29+00:00\",\"dateModified\":\"2016-07-07T12:05:12+00:00\",\"author\":{\"@id\":\"https:\/\/crossan007.dev\/blog\/#\/schema\/person\/bd99569cd81332c8fd866d023848b979\"},\"breadcrumb\":{\"@id\":\"https:\/\/crossan007.dev\/blog\/microsoft-sharepoint\/collecting-user-data-in-sharepoint-2010-with-custom-site-columns\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/crossan007.dev\/blog\/microsoft-sharepoint\/collecting-user-data-in-sharepoint-2010-with-custom-site-columns\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/crossan007.dev\/blog\/microsoft-sharepoint\/collecting-user-data-in-sharepoint-2010-with-custom-site-columns\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/crossan007.dev\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Collecting User Data in SharePoint 2010 with custom Site Columns\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/crossan007.dev\/blog\/#\/schema\/person\/bd99569cd81332c8fd866d023848b979\",\"name\":\"crossan007\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/crossan007.dev\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/fff72c74fb6a0da29accf0db83ad4b4b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/fff72c74fb6a0da29accf0db83ad4b4b?s=96&d=mm&r=g\",\"caption\":\"crossan007\"},\"url\":\"https:\/\/crossan007.dev\/blog\/author\/crossan007\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/crossan007.dev\/blog\/microsoft-sharepoint\/collecting-user-data-in-sharepoint-2010-with-custom-site-columns\/","og_locale":"en_US","og_type":"article","og_title":"Collecting User Data in SharePoint 2010 with custom Site Columns - Charles&#039; Blog","og_description":"The Task: Build a system to archive paper documents (being scanned from e-mail enabled scanners) and optimize for retrieval I decided to build an E-Mail enabled library to get the documents into SharePoint. \u00a0 This allows users to save the email address in their contact list on the copier, and makes scanning in documents very &hellip; Continue reading Collecting User Data in SharePoint 2010 with custom Site Columns &rarr;","og_url":"https:\/\/crossan007.dev\/blog\/microsoft-sharepoint\/collecting-user-data-in-sharepoint-2010-with-custom-site-columns\/","og_site_name":"Charles&#039; Blog","article_published_time":"2015-01-26T18:41:29+00:00","article_modified_time":"2016-07-07T12:05:12+00:00","og_image":[{"width":35,"height":37,"url":"https:\/\/crossan007.dev\/blog\/wp-content\/uploads\/2015\/01\/Untitled.png","type":"image\/png"}],"twitter_misc":{"Written by":"crossan007","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/crossan007.dev\/blog\/#website","url":"https:\/\/crossan007.dev\/blog\/","name":"Charles&#039; Blog","description":"SharePoint | PowerShell | Exchange | SCCM | Ubuntu | PHP | JavaScript | A\/V Live Production | More...","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/crossan007.dev\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/crossan007.dev\/blog\/microsoft-sharepoint\/collecting-user-data-in-sharepoint-2010-with-custom-site-columns\/#primaryimage","inLanguage":"en-US","url":"https:\/\/crossan007.dev\/blog\/wp-content\/uploads\/2015\/01\/Untitled.png","contentUrl":"https:\/\/crossan007.dev\/blog\/wp-content\/uploads\/2015\/01\/Untitled.png","width":35,"height":37},{"@type":"WebPage","@id":"https:\/\/crossan007.dev\/blog\/microsoft-sharepoint\/collecting-user-data-in-sharepoint-2010-with-custom-site-columns\/#webpage","url":"https:\/\/crossan007.dev\/blog\/microsoft-sharepoint\/collecting-user-data-in-sharepoint-2010-with-custom-site-columns\/","name":"Collecting User Data in SharePoint 2010 with custom Site Columns - Charles&#039; Blog","isPartOf":{"@id":"https:\/\/crossan007.dev\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/crossan007.dev\/blog\/microsoft-sharepoint\/collecting-user-data-in-sharepoint-2010-with-custom-site-columns\/#primaryimage"},"datePublished":"2015-01-26T18:41:29+00:00","dateModified":"2016-07-07T12:05:12+00:00","author":{"@id":"https:\/\/crossan007.dev\/blog\/#\/schema\/person\/bd99569cd81332c8fd866d023848b979"},"breadcrumb":{"@id":"https:\/\/crossan007.dev\/blog\/microsoft-sharepoint\/collecting-user-data-in-sharepoint-2010-with-custom-site-columns\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/crossan007.dev\/blog\/microsoft-sharepoint\/collecting-user-data-in-sharepoint-2010-with-custom-site-columns\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/crossan007.dev\/blog\/microsoft-sharepoint\/collecting-user-data-in-sharepoint-2010-with-custom-site-columns\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/crossan007.dev\/blog\/"},{"@type":"ListItem","position":2,"name":"Collecting User Data in SharePoint 2010 with custom Site Columns"}]},{"@type":"Person","@id":"https:\/\/crossan007.dev\/blog\/#\/schema\/person\/bd99569cd81332c8fd866d023848b979","name":"crossan007","image":{"@type":"ImageObject","@id":"https:\/\/crossan007.dev\/blog\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/fff72c74fb6a0da29accf0db83ad4b4b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fff72c74fb6a0da29accf0db83ad4b4b?s=96&d=mm&r=g","caption":"crossan007"},"url":"https:\/\/crossan007.dev\/blog\/author\/crossan007\/"}]}},"_links":{"self":[{"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/posts\/24"}],"collection":[{"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/comments?post=24"}],"version-history":[{"count":7,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/posts\/24\/revisions"}],"predecessor-version":[{"id":192,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/posts\/24\/revisions\/192"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/media\/33"}],"wp:attachment":[{"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/media?parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/categories?post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/tags?post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}