How to set a list lookup form control connected to a text column


Badge +3

Ok, here is a weird one.  I have a text column that contains an employee number.  On my form I set the value of this column using a List Lookup control.  This is so that it is not truly a list lookup column, but the possible entries are restricted to the list of available employees.  So far everything is working great.  The problem comes in whenever I try to create or update an item using a workflow.  I am using Nintex Workflow and Forms 2010.

 

If I upload the document to the library and use the item form to update the fields, then the value is visible on the form when viewing the document properties.

 

When updating Employee Number using the Nintex Form

2014-10-09_9-30-25.png

2014-10-09_9-30-25.png

 

When updating Employee Number using a workflow

2014-10-09_9-30-25.png

2014-10-09_9-30-25.png

 

I have tried to discover if there was any extra information being stored in the field to make it link properly on the form but there isn't anything.  No ID or anything like that.  Not sure how to set a field like this and still have the value on the form.


10 replies

Badge +17

Patrick,

I'm not quite sure I understand your question.  You said you had the links working fine in the form.  Are you saying things break when you use the workflow to create a new item?

Also this got kinda confusing... On my form I set the value of this column using a List Lookup control.  This is so that it is not truly a list lookup column, but the possible entries are restricted to the list of available employees. 

What are you really trying to do here?

Badge +3

Yes, things break if I try to create or update an item using a workflow.  The column that the list lookup control is connected to is a single line of text column.  I use the List Lookup control to limit the text that can be entered into the column, but I don't want to two to be linked at the library level.

Userlevel 5
Badge +12

I'm also a bit confused by the description:

"I have a text column that contains an employee number.  On my form I set the value of this column using a List Lookup control.  This is so that it is not truly a list lookup column, but the possible entries are restricted to the list of available employees."

So for example, why not on the form use a List Lookup control which then points to a list that contains the available employees from which you can select a value?   What is the point of having a text control connected to a List lookup control?   Why not just allow the List Lookup control be the control from which the employee is selected.

There might be something I'm misunderstanding here.

Badge +3

Sorry for the confusion in my description mmatsako‌, but that is exactly what I am doing.

I have a single line text column who's value is controlled by a list lookup control on the form.

Userlevel 5
Badge +12

Alright, makes sense.  You have a List Lookup control on your form, and you connected it to a single line text column in the backing list.   This stores your selection in the text field.

So the problem you are running into is: if you programmatically try to set the text field column in the list within your workflow, and then go to view that item within the form, you are not getting that displayed value in the List Lookup control.

So what you are going to want to do is => within your workflow, where you are setting the value of this "text field" you need to use as your source the same list that you target on the form,  do a  "Lookup" on a set value action to point to the same source list that you are drawing from on your form to obtain the right id of that list item.

The list lookup control utilizes the ID of the list item, rather than the actual text value behind the scenes.  By doing it this way, you should create the correct reference that is needed by the form to render the selected item properly.

Badge +3

Ok, I think I got what you are saying, but I am missing something.


mmatsako wrote:



So what you are going to want to do is => within your workflow, where you are setting the value of this "text field" you need to use as your source the same list that you target on the form,  do a  "Lookup" on a set value action to point to the same source list that you are drawing from on your form to obtain the right id of that list item.



The list lookup control utilizes the ID of the list item, rather than the actual text value behind the scenes.  By doing it this way, you should create the correct reference that is needed by the form to render the selected item properly.


I retrieve the ID from the source list of the lookup, but whenever I set that as the value for the text field, it just shows that value on the view and still nothing in the form.  The employee number should be ‌03463‌ not ‌919.

2014-10-09_9-30-25.png

2014-10-09_9-30-25.png

Userlevel 5
Badge +12

Here is a workaround for you:

I am assuming that in your List Lookup control you have the "text connected" option pointing to your Text Column in your SharePoint list.

Create a second text column in your list called ListLookupID or something similar.   Then set the "ID connected" to option on your list lookup in your form to point to this new column.

Then, in your workflow create a variable you will use to store the ID.   Then use a set variable action to do a Lookup on the source list, get its ID and store it into your variable:

Source:   Your List

Field:  ID

When:  Title (or whatever will work in your list)

Equals value (whatever you want the text value to equal in that list)

Next action: Use an Update Item action to update your current item's ListLookupID column (the one we just created) with the ID we just got back from using the set variable action.   You can also update your item's text field if you want but it'll display without it.

Now your form will display the name correctly.

There is probably several different ways to get this going, but this was a quick sample I put together.

Badge +3

I ended up querying the employee number list using CAML and Javascript to get this accomplished.

Badge +4

I had the same problem in nintex for Office 365. I just wanted the text not the value of the "select control". Through "Text connected to", it was work well in nintex form, Edit form is OK. but in workflow, it didn't work. The text stored in the list wasn't selected. I think it's a bug. "ID connected to" will make it, but doubled the columns,  it's not good.

Badge

Patrick,

Would you be able to share your solution? We're dealing with the same issue but have been unable to get any Javascript to work in this situation.

Reply