Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Extracting text from a lookup field in a SharePoint 2013 workflow

Posted on 2014-01-14
8
Medium Priority
?
16,101 Views
Last Modified: 2016-04-04
Drawing a blank here...the overall project is a bit complex so I figured I would simplify things...

I have a custom list with a column that has a look-up field.  I need to populate what is chosen there to populate another column in that same list.

So for example, I have a pull-down list called "Sandwich" and "Big-Mac" is chosen it would populate a  "Sandwich Text" field.

Other info.
I'm a SharePoint consultant and the farm is a Dev so I can I have all of tools available to me, SharePoint Designer 2013, Visual Studio, etc.  :)
This would need to go into a workflow or into Visual Studio solution that I will deploy.
Eventually, this will be used to create an item in another list and populate "Big-Mac" in a column on that list but didn't want to confuse things here ;p

Thanks!
-Scott
0
Comment
Question by:k94ss01
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 50
ID: 39781582
Hello,

If this were a choice column, you could use a calculated column to pull the text into another field. But that does not work with a lookup column.

The choice column scenario is like this:

One column is called "Sandwich Text". You want to populate that column with the value chosen in another field, which is a Choice column called "Sandwich".  So you make the "Sandwich Text" column a calculated column and set it to the "Sandwich" column.

screenshot 1
Then you create a new item in the list, select a value in the "Sandwich" column and save. The "Sandwich Text" column will display just that value.

screenshot 2
But if the "Sandwich" is a lookup field to another list in the Sharepoint site, this will not work, since lookup columns cannot be used in calculated columns.

So, as an alternative to a calculated column you may want to use a workflow to update the "Sandwich Text" column.

Give me a moment while I fire up SharePoint Designer 2013. I'll report back.

cheers, teylyn
0
 
LVL 50

Accepted Solution

by:
Ingeborg Hawighorst (Microsoft MVP / EE MVE) earned 1000 total points
ID: 39781644
So, if you want to pull the value of a Lookup column into another field, you can do this with a SharePoint workflow.

In my example, I have created a list with lookup values and then linked the new column "SandwichLookup" to that list. I want to grab the value of that column and put it into a text column called "SandwichLookupText"

To do this, I fired up SharePoint Designer 2013 and created a  workflow that fires when an item is created or changed. The workflow steps are outlined in this screenshot:

workflow steps
When I go and edit a list item in the Sandwich list, the workflow will kick in and copy the value from the lookup column "SandwichLookup" to the text field "SandwichLookupText"

result of the workflow
cheers, teylyn
0
 
LVL 50
ID: 39921703
Hello, why the B grade? What would you have expected for an A grade? What extra effort do you need to put in to make this work?
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

Author Comment

by:k94ss01
ID: 39921718
Sorry, I meant an A!  I got it mixed up with the other question I asked!
0
 

Author Comment

by:k94ss01
ID: 39921722
Is there a way to change it?
0
 
LVL 50
ID: 39922070
I'll get the mods to change it.
0
 

Author Comment

by:k94ss01
ID: 39922077
Thanks,

I had another InfoPath issue and didn't know I could only have two open so I hurried up and closed them.  If you know anything about the following http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/MS-SharePoint/Q_28385997.html I would be eternally grateful!!!!!
0
 

Expert Comment

by:Cmclean67
ID: 41534401
Hi, I tried this solution, but received a suspended workflow message.  I am using SP 2013.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary In SharePoint 2010 it is easy to create custom color themes to jazz up a site. Theme colors can also be created in PowerPoint 2010 with a few clicks. But how do the chosen colors actually look in the SharePoint site? The attached PowerPoint…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question