Solved

Extracting text from a lookup field in a SharePoint 2013 workflow

Posted on 2014-01-14
8
13,756 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
  • 4
  • 3
8 Comments
 
LVL 50

Expert Comment

by:Ingeborg Hawighorst
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 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

Expert Comment

by:Ingeborg Hawighorst
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

Expert Comment

by:Ingeborg Hawighorst
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sharepoint - Approval workflow question 1 79
Sharepoint 2016 - all-in-one-server vs. two servers 24 82
Citrix sharefile 1 81
Sharepoint data after Hyper-V restore 4 22
The Scenario: Let’s say you have a quote worksheet in Excel that you use to work up sales figures and such for your clients. You utilize SharePoint to manage and keep track of these documents. You would like values from your worksheet to populate Sh…
Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

808 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