Solution: Converting lookup values to text and working around SharePoint error “lookup list is in another web”

notsupportedinquery.PNG

Lookup columns aren’t friendly to a lot of things. Power BI reports, calculated columns, creating new items via workflow when both lists have lookup columns, if/then statements, etc. Especially when your lookup column is looking up to a list from another site, not the same subsite in which you’re working.

A previous scenario required that I create a new item in a different site’s list when conditions were met in the origin site’s list item. Both lists used the same lookup column, and I received the “lookup is in another web” error when trying to do a direct copy via workflow, from lookup column to lookup column. The solution ended up being creating a new item in a temporary, lookup-free list that received the lookup values just as text. Then SharePoint Designer copied those over to the final list, which received the text and happily converted it back to the appropriate lookup values. See the full solution here.

This post will focus on the same error message, but this time is triggered by a SharePoint Designer workflow in a different scenario where we just want to convert our lookup values to text so we can use them for various purposes.

To save you time, I also tried (and failed) at these potential solutions before finding success:

  • Setting workflow variables to the lookup values and trying to set the variables to text values, or use the variables in my if/then statements to create new text values (this defeats the purpose of using lookup columns, of course)
  • Using a number of combinations of Microsoft Flow and SharePoint Designer to get the data from the lookup column extracted then “pasted” back in as text

So let’s get to the solution. Feel free to comment with your scenario specifics – I’ve had a lot of experience with this error, and would be happy to help.

First and foremost, note that much of my trial and error was with SharePoint Designer 2013 workflows and Microsoft Flow. You must use a SharePoint Designer 2010 workflow for this to work. And remember, you can start a 2010 workflow from within a 2013 workflow, so it shouldn’t interfere too much with your larger processes.

You will need:

  • A new single line of text column for each lookup column you want to “convert” to text (i.e. WFTextDivision, WFTextUnit, etc.)
  • SharePoint Designer
  1. Create a SPD 2010 Workflow on the list which you’d like text values instead of lookup values. (List workflow –> select list name)
    newworkflowonlist2
  2. Name and describe your workflow, then select SharePoint 2010 Workflow as platform type. Click OK.
    2010workflow
  3. Type “update” and hit enter.
    LookuptoText1
  4. Click “this list”
    lookuptotext2
  5. Click “Add” and find the new TEXT field that matches the lookup column field you’re setting. Then click the “function” button next to “to this value”.
    lookuptotext3
  6. Find the lookup column for the second field, and set “return field as” to “Lookup Value (as Text)”
    lookuptotext4
  7. Click OK twice, and repeat steps 5-7 for each field you need to have converted. Then click OK.
    lookuptotext.png
  8. Go to the workflow settings and, under “Start Options”, set this to run manually, when items are created and when items are modified. This just ensures your text fields are always being updated to the lookup values.startoptions

That’s it! Publish your workflow, and your lookup columns’ values will always be converted to text. You can then use those WFTextABC columns in Power BI reports, workflows, if/then statements, calculated columns and more where we couldn’t before with lookup values.

 

Advertisements

2 thoughts on “Solution: Converting lookup values to text and working around SharePoint error “lookup list is in another web”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s