Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 7025

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 2162

Deprecated: Hook imagify_allow_picture_tags_for_webp is deprecated since version 2.2! Use imagify_allow_picture_tags_for_nextgen instead. in /www/collab365_296/public/wp-includes/functions.php on line 5758
Setting a Multi-Value Lookup Column Using SharePoint Designer Workflow – Part 1 - Collab365
Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1145

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1152

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1155

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1162

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1165

Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1145

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1152

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1155

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1162

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1165

Warning: Undefined array key "url" in /www/collab365_296/public/wp-content/plugins/thrive-visual-editor/thrive-dashboard/inc/smart-site/classes/class-tvd-smart-shortcodes.php on line 85

2015-01-13

I ran into another request recently which tied closely to a solution that I previously built a blogged about: Utilizing new related items column via workflow.  In that solution we had a custom list tracking project deliverable information and a document library used to stored the final documents.  When final deliverable documents were uploaded, the related deliverable in the custom list was selected, and a workflow ran in which the related items field on the tracker was updated for the selected deliverable.  That means as documents were added to the library the related items in the list would be updated to align the list and the library.

Due to some view limitations when looking at the items we wanted to move to a multi-value lookup column instead of a related items column.  The same scenario exists in which we want to show the deliverable documents in the deliverable list and there can be multiple documents that apply to single deliverable. 

  • This post will outline the format and the steps to update a multi-value column once via workflow.
  • Part 2 will outline how to loop through and then append both the current value of the lookup column and the new value.

In this scenario:

  1. Deliverable Documents is the multi-value lookup column in the Deliverable Tracker custom list
  2. Related Deliverable is the lookup column on the Deliverable Documents library

Format – Single Value

When setting a single value in a lookup column you want to use the ID of the piece of content that should be in the lookup column.  This ID should be in the integer format.

In this screenshot we are setting the Deliverable Documents field (lookup column!) to the Current Item:ID where the ID of the Deliverable Tracker matches the Related Deliverable Lookup Id (as Integer).

Format – Multi-Value

When setting a multi-value lookup column you want to use”;#;#” as the delimiter between the IDs of the pieces of content that should be in the lookup column. 

For example:  1;#;#2;#;#3;#;#4

Another major note:  This update action needs to be ran using a SharePoint 2010 Workflow.  The way I prefer to do this is build my primary workflow in using a SharePoint 2013 template and calling the 2010 template inside of it.

In this screenshot we are setting the Deliverable Documents field to [%Current Item:ID%];#;#[Deliverable Documents:ID%] where the ID of the Deliverable Tracker matches the Related Deliverable Lookup Id (as Integer).  This passes 2 values to the lookup field.  The first is the Current Item ID and the second is an ID of a document that I want to include on all items.

We have one issue with this scenario.  If we want to add another value to the multi-value lookup column and not replace the current values, we will need to gather the current value and append the new ID.  I will outline how to do this in Part 2!

Originally Posted

Setting a Multi-Value Lookup Column Using SharePoint Designer Workflow – Part 1

(Visited 483 times, 1 visits today)

About the author 

Drew Madelung

Summit Bundle

Get 200+ hours of Microsoft 365 Training for 27$!

Master Office 365, Power Platform & SharePoint & Teams With 200+ Hours Of Training Videos and 108 Ebooks in the Collab365 Academy. This offer is insane and is only available for a limited period.