Skip to main content
Nintex Community Menu Bar
Solved

Getting the value of a SharePoint Lookup column in NWC workflow

  • October 21, 2022
  • 5 replies
  • 964 views
  • Translate

Forum|alt.badge.img+3

I have not been able to find this answered else, so I apologize if it has already been answered. We are migrating our workflows from SharePoint 2013 to NWC and we frequently use values from the SharePoint look-up column types in the list in our workflows.  These are normally stored in the list as an ID for the value in the related list.  The SharePoint workflow products appear to be able to provide the value from the look-up column without an additional query, but NWC only provides the ID of the look-up column value in the start object. What is the best approach to get the mapped value from the lookup column? 

Best answer by ethurber

Hello

I believe the only solution is to use the "Retrieve and item" action and pass it the ID (as an int) from the lookup field.

 

Hope this helps.

Ed

View original
Did this topic help you find an answer to your question?

5 replies

Forum|alt.badge.img+6
  • Rookie
  • 51 replies
  • Answer
  • October 21, 2022

Hello

I believe the only solution is to use the "Retrieve and item" action and pass it the ID (as an int) from the lookup field.

 

Hope this helps.

Ed

Translate

Gavin-Adams
Forum|alt.badge.img+13
  • Communicator
  • 182 replies
  • October 23, 2022

Hi @clrowe1124 ,

I think this might be part of the limitation of the SharePoint API that is triggering the start of the workflow.

I did a quick list with a lookup column.

First config was lookup column as title only.

Second config was lookup column settings as ID plus show Title as additional column displayed.

 

In both cases when I look at the API output (eg [SiteURL]/_api/web/lists/GetByTitle('TestLookup')/items)

it only displays the ID value for the column name in the API output.

 

I created a workflow to start as sharepoint online and new item created. From this I can only see the ID value in the lookup column. So from that you would need to do a query list to lookup the value in the workflow actions.

If doing a nintex form as the start action, the other options for looking this up would a data source lookup control or an external data source.

 

I did have a test with other API options such as:  /_api/web/lists/GetByTitle('TestLookup')/items(1)/FieldValuesAsText

In this case it retrived the display values of the lookup column rather than the underlying ID value.

 

It could be worth raising as an idea to return both the internal ID and display value for a lookup column in the workflow. https://ideas.nintex.com/ 

Translate

Forum|alt.badge.img+3
  • Author
  • Rookie
  • 23 replies
  • October 24, 2022

Using that action did the trick. I was looking for a single action vs "Query a List" that requires a loop to use the item the query retrieves.  Thanks for suggestion.

Translate

Forum|alt.badge.img+5
  • Apprentice
  • 30 replies
  • July 12, 2023

@Gavin-Adams: I have added such idea: Provide values from Multi-Lookup column in Start-Event | Nintex Ideas

Of course, I got it to work, but it would be much better, to have these values just like this :)

Translate

Forum|alt.badge.img
  • Novice
  • 1 reply
  • August 7, 2023

What if the lookup column has multiple values?

NWC gives me the value like this:

“1;2;3”

I can’t find an action that will allow me to convert this to an array through which I can loop and do a query.

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings