Solved

Extracting text from a lookup field in a SharePoint 2013 workflow

Posted on 2014-01-14
8
15,342 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 250 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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For SharePoint sites, particularly public-facing ones, there are times when adding JavaScript, Meta Tags, CSS Styles or other content to the page <head> section is more practical than modifying master pages.  For instance, you could add the jQuery l…
The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

630 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