cancel
Showing results for 
Search instead for 
Did you mean: 
thomas_stoller
Nintex Newbie

Lookup linked item through lookup field

Jump to solution

I have the following challenge. We have two lists Events and Participants. When creating a Participant item a lookup field has to be filled, where the Event needs to be selected. This is everything straight forward.

Then a workflow is started with every new created Participant. In the workflow I need to assign a value from the linked Event to a workflow variable.

I thought this was an easy task, because I have the ID from the Event item in my lookup field. But when I use the value in the lookup field in Nintex it is only the Title and no ID from the Event item. How can I get the ID, because I don't like to filter the list based on the title text (because it might change).

Any solutions?

Labels: (1)
Reply
6 Replies
stuart_holding
Nintex Newbie

Re: Lookup linked item through lookup field

Jump to solution

Hi Thomas,

I assume that you are using Nintex Forms and a drop down control to display your events?

When the user selects a value of the drop down, the value of the selected option can be found as a formatted string as "[ID];#[Title]". If you add a calculated control to your form and set it's formula to the value of your events "Named Control", you can see this value output. e.g.

DropDownValue.PNG

This should be the value saved in your list column. You should be therefore able to use the Regular Expression action to trim out the ID of the value and assign it to the workflow variable.

Off the top of my head, I think I would have to:

  • Do a 'Split' regex action on the lookup column using the pattern "(;#)"
  • Pull the first item from the collection variable that you'll assign your split output to
  • This should give you your ID.

Cheers,

Stu

Reply
thomas_stoller
Nintex Newbie

Re: Lookup linked item through lookup field

Jump to solution

Hi Stu

Unfortunately I'm not using it in a form, but in a workflow step (set variable).

There the field does not contain ID;#Text as it does in raw SharePoint, it only returns the text part.

So where has the ID gone? Why is it stripped off?

Kind regards,

Thomas

0 Kudos
Reply
Not applicable

Re: Lookup linked item through lookup field

Jump to solution

Hi Thomas,

Try to do the following on Set Workflow Variable action, see if this helps:

0 Kudos
Reply
abhilashpatnaik
Nintex Newbie

Re: Lookup linked item through lookup field

Jump to solution

WHy dont I see the option as ID, Have two option as string and as lookup value as text

0 Kudos
Reply
tech-bar19
Nintex Newbie

Re: Lookup linked item through lookup field

Jump to solution

I was running into this problem as well on our on-premise installation. If Nintex for Office 365 is anything like it, then by setting the variable as an Integer first, the action will automatically use the ID. On the other hand, if the variable is text, it defaults to Value and does not let me change it.

0 Kudos
Reply
Community Manager Community Manager
Community Manager

Re: Lookup linked item through lookup field

Jump to solution

@tech-bar19 and @abhilashpatnaik when using the lookup, your variable will be a text or number. This doesn't really matter. 

 

When you use the lookup, you can choose the Current Item > ID this will come in as a string. If the workflow is running on the current item created such as the event, to create the participant for that event, then this should be running against the current item. I'm not sure why you would need to set this instead of just creating a new item and copying the ID or title when you do that to bind it.

0 Kudos
Reply