{"id":378,"date":"2016-07-07T10:33:55","date_gmt":"2016-07-07T14:33:55","guid":{"rendered":"https:\/\/www.ccrossan.com\/?p=378"},"modified":"2016-07-07T10:33:55","modified_gmt":"2016-07-07T14:33:55","slug":"display-approval-tasks-infopath-form","status":"publish","type":"post","link":"https:\/\/crossan007.dev\/blog\/infopath\/display-approval-tasks-infopath-form\/","title":{"rendered":"Display Approval Tasks on InfoPath Form"},"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>I&#8217;be been working through building InfoPath forms to streamline the approval process of some internal documents, and one of the project requirements is to display the date \/ time as well as comments of each person who approves a document.<\/p>\n<p>I built a SharePoint Designer workflow which first\u00a0computes\u00a0the approval routing (which varies between 8 and 10 approvers depending on the value of some fields), \u00a0then collects the approvals via the &#8220;Start Approval Process&#8221; task, and then emails up to 10 SharePoint groups based on a different set of criteria on each document.<\/p>\n<p>SharePoint Designer Workflows store these &#8220;Assigned Tasks&#8221; in a <a href=\"https:\/\/blogs.msdn.microsoft.com\/sharepointdesigner\/2008\/03\/31\/associate-an-spd-workflow-with-a-specific-task-list\/\">Task List, which the developer is able to specify<\/a>. \u00a0Each Task in the Task List contains a\u00a0<em>HIDDEN COLUMN<strong>\u00a0<\/strong><\/em>called <strong>WorkflowItemId<\/strong> which associates the Task with the Item against which the workflow is running. \u00a0 This column is a pesky little bugger for reasons explained below.<\/p>\n<p>There is a <a href=\"http:\/\/www.coolgeek.info\/?p=142\">blog post<\/a> which describes one method for displaying all approvals tasks on the actual InfoPath form which goes roughly as follows:<\/p>\n<ol>\n<li>Create a new custom list containing all of the columns you need to reference<\/li>\n<li>Edit the &#8220;Behavior of a Single Task&#8221; for the Approval Process in question so that if the outcome is approved, add a new item to the custom list<\/li>\n<li>Add a Data Connection on the InfoPath form to pull data from the new custom list and display it on the form.<\/li>\n<\/ol>\n<p>I didn&#8217;t want to go through the hassle of creating a\u00a0<em>separate list <\/em>for each workflow I&#8217;m running, just to store data that&#8217;s already being stored in the associated Task List.<\/p>\n<p>So, the big question:\u00a0<strong>Why don&#8217;t you just add the Task List as an InfoPath Datasource and call it a day?<\/strong><\/p>\n<p>Well, the answer to that question may infuriate you: you are unable to filter the list according to the ID of the item in question because the attribute that stores the item id (WorkflowItemId) is\u00a0<strong>forcibly hidden!\u00a0<\/strong><\/p>\n<ul>\n<li>InfoPath does not provide WorkflowItemId as an option in the Data Connection query path.<\/li>\n<li>CSOM CAML queries error out when you attempt to use WorkflowItemId as a query field, so the SOAP \/ REST Data Connections in InfoPath also fail.<\/li>\n<\/ul>\n<p>Other than the solution above, there are really only two other options:<\/p>\n<ul>\n<li>[WARNING: Unsupported] :<a href=\"https:\/\/discoveringsharepoint.wordpress.com\/2014\/09\/08\/unhide-a-hidden-spfield-using-powershell\/\"> You could use SharePoint Reflection to un-hide<\/a> the WorkflowItemId field, and then query it within InfoPath.<\/li>\n<li>Write a SharePoint<a href=\"https:\/\/github.com\/bciu22\/ApprovalTaskListService\"> Web Service that uses SSOM<\/a> to query the Task List according to a parameterized input of the workflow item id, site name, and task list name.<\/li>\n<\/ul>\n<p>I went the second route, and created such a web service, which is available here:\u00a0<a href=\"https:\/\/github.com\/bciu22\/ApprovalTaskListService\">https:\/\/github.com\/bciu22\/ApprovalTaskListService<\/a>.<\/p>\n<p>The result is that you can add an InfoPath Data Connection that looks something like this:<\/p>\n<p id=\"DMHMaTn\"><img loading=\"lazy\" width=\"614\" height=\"463\" class=\"alignnone size-full wp-image-380 \" src=\"https:\/\/www.ccrossan.com\/wp-content\/uploads\/2016\/07\/img_577e666451169.png\" alt=\"\" srcset=\"https:\/\/crossan007.dev\/blog\/wp-content\/uploads\/2016\/07\/img_577e666451169.png 614w, https:\/\/crossan007.dev\/blog\/wp-content\/uploads\/2016\/07\/img_577e666451169-300x226.png 300w\" sizes=\"(max-width: 614px) 100vw, 614px\" \/><\/p>\n<p>So that you can have a repeating table on your form with all approvals that looks something like this:<\/p>\n<p id=\"oLDCCIW\"><img loading=\"lazy\" width=\"805\" height=\"353\" class=\"alignnone size-full wp-image-381 \" src=\"https:\/\/www.ccrossan.com\/wp-content\/uploads\/2016\/07\/img_577e67234be3a.png\" alt=\"\" srcset=\"https:\/\/crossan007.dev\/blog\/wp-content\/uploads\/2016\/07\/img_577e67234be3a.png 805w, https:\/\/crossan007.dev\/blog\/wp-content\/uploads\/2016\/07\/img_577e67234be3a-300x132.png 300w, https:\/\/crossan007.dev\/blog\/wp-content\/uploads\/2016\/07\/img_577e67234be3a-768x337.png 768w\" sizes=\"(max-width: 805px) 100vw, 805px\" \/><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;be been working through building InfoPath forms to streamline the approval process of some internal documents, and one of the project requirements is to display the date \/ time as well as comments of each person who approves a document. I built a SharePoint Designer workflow which first\u00a0computes\u00a0the approval routing (which varies between 8 and &hellip; <a href=\"https:\/\/crossan007.dev\/blog\/infopath\/display-approval-tasks-infopath-form\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Display Approval Tasks on InfoPath Form<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[128],"tags":[178,182,130,47,180,181,15],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<meta name=\"description\" content=\"You are unable to filter the list according to the ID of the item in question because the attribute WorkflowItemId is forcibly hidden!\" \/>\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\/infopath\/display-approval-tasks-infopath-form\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Display Approval Tasks on InfoPath Form - Charles&#039; Blog\" \/>\n<meta property=\"og:description\" content=\"You are unable to filter the list according to the ID of the item in question because the attribute WorkflowItemId is forcibly hidden!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/crossan007.dev\/blog\/infopath\/display-approval-tasks-infopath-form\/\" \/>\n<meta property=\"og:site_name\" content=\"Charles&#039; Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-07-07T14:33:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.ccrossan.com\/wp-content\/uploads\/2016\/07\/img_577e666451169.png\" \/>\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=\"2 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\/infopath\/display-approval-tasks-infopath-form\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.ccrossan.com\/wp-content\/uploads\/2016\/07\/img_577e666451169.png\",\"contentUrl\":\"https:\/\/www.ccrossan.com\/wp-content\/uploads\/2016\/07\/img_577e666451169.png\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/crossan007.dev\/blog\/infopath\/display-approval-tasks-infopath-form\/#webpage\",\"url\":\"https:\/\/crossan007.dev\/blog\/infopath\/display-approval-tasks-infopath-form\/\",\"name\":\"Display Approval Tasks on InfoPath Form - Charles&#039; Blog\",\"isPartOf\":{\"@id\":\"https:\/\/crossan007.dev\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/crossan007.dev\/blog\/infopath\/display-approval-tasks-infopath-form\/#primaryimage\"},\"datePublished\":\"2016-07-07T14:33:55+00:00\",\"dateModified\":\"2016-07-07T14:33:55+00:00\",\"author\":{\"@id\":\"https:\/\/crossan007.dev\/blog\/#\/schema\/person\/bd99569cd81332c8fd866d023848b979\"},\"description\":\"You are unable to filter the list according to the ID of the item in question because the attribute WorkflowItemId is forcibly hidden!\",\"breadcrumb\":{\"@id\":\"https:\/\/crossan007.dev\/blog\/infopath\/display-approval-tasks-infopath-form\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/crossan007.dev\/blog\/infopath\/display-approval-tasks-infopath-form\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/crossan007.dev\/blog\/infopath\/display-approval-tasks-infopath-form\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/crossan007.dev\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Display Approval Tasks on InfoPath Form\"}]},{\"@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":{"description":"You are unable to filter the list according to the ID of the item in question because the attribute WorkflowItemId is forcibly hidden!","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\/infopath\/display-approval-tasks-infopath-form\/","og_locale":"en_US","og_type":"article","og_title":"Display Approval Tasks on InfoPath Form - Charles&#039; Blog","og_description":"You are unable to filter the list according to the ID of the item in question because the attribute WorkflowItemId is forcibly hidden!","og_url":"https:\/\/crossan007.dev\/blog\/infopath\/display-approval-tasks-infopath-form\/","og_site_name":"Charles&#039; Blog","article_published_time":"2016-07-07T14:33:55+00:00","og_image":[{"url":"https:\/\/www.ccrossan.com\/wp-content\/uploads\/2016\/07\/img_577e666451169.png"}],"twitter_misc":{"Written by":"crossan007","Est. reading time":"2 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\/infopath\/display-approval-tasks-infopath-form\/#primaryimage","inLanguage":"en-US","url":"https:\/\/www.ccrossan.com\/wp-content\/uploads\/2016\/07\/img_577e666451169.png","contentUrl":"https:\/\/www.ccrossan.com\/wp-content\/uploads\/2016\/07\/img_577e666451169.png"},{"@type":"WebPage","@id":"https:\/\/crossan007.dev\/blog\/infopath\/display-approval-tasks-infopath-form\/#webpage","url":"https:\/\/crossan007.dev\/blog\/infopath\/display-approval-tasks-infopath-form\/","name":"Display Approval Tasks on InfoPath Form - Charles&#039; Blog","isPartOf":{"@id":"https:\/\/crossan007.dev\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/crossan007.dev\/blog\/infopath\/display-approval-tasks-infopath-form\/#primaryimage"},"datePublished":"2016-07-07T14:33:55+00:00","dateModified":"2016-07-07T14:33:55+00:00","author":{"@id":"https:\/\/crossan007.dev\/blog\/#\/schema\/person\/bd99569cd81332c8fd866d023848b979"},"description":"You are unable to filter the list according to the ID of the item in question because the attribute WorkflowItemId is forcibly hidden!","breadcrumb":{"@id":"https:\/\/crossan007.dev\/blog\/infopath\/display-approval-tasks-infopath-form\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/crossan007.dev\/blog\/infopath\/display-approval-tasks-infopath-form\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/crossan007.dev\/blog\/infopath\/display-approval-tasks-infopath-form\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/crossan007.dev\/blog\/"},{"@type":"ListItem","position":2,"name":"Display Approval Tasks on InfoPath Form"}]},{"@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\/378"}],"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=378"}],"version-history":[{"count":5,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/posts\/378\/revisions"}],"predecessor-version":[{"id":385,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/posts\/378\/revisions\/385"}],"wp:attachment":[{"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/media?parent=378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/categories?post=378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/tags?post=378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}