How to set a lookup control in a Nintex Form, either with Powershell or with a Nintex Workflow?

  • 3 February 2017
  • 4 replies
  • 21 views

Badge +2

Hi Nintex Community,

I have a question about the use of Nintex Forms with a List Lookup Control and Powershell.

Situation: The Form has a LLC that is connected to a text field. The control is connected to a list and filtered with a named control. This is working perfect. When I choose something from the dropdown, it is perfectly saved in the column. And I can filter on it with views, or group by or ... And the form looks good.

I need now to migrate another list to this list. With PowerShell I map the correct columns. When I run the script, the text field is populated with the correct text. I can see the field in every view, and grouping/fitering  etc is also working.

198312_pastedImage_1.png

But...

... when I open the form, the field is empty ( or in Edit Mode "Select a value").

198313_pastedImage_2.pngor 198323_pastedImage_3.png

When I change something else, and save, the field in the views in SP list is still correct with the value that was put in with PowerShell (so also the filtering).

So this value is saved, probably in a hidden field?

Question:   How can I fill in with Powershell this value (SP Text column), so that is appears also in the Nintex Form in the Lookup Control?

Any ideas?

Greets,

Peter


4 replies

Badge +2

Hi,

I did some testing with a Nintex Workflow for filling up the text field, same result.

Greets,

Peter

Badge +6

Hey Peter De Meester‌,

I just had a look on it and ran into the same problem. But I found out, that it works if you do not store the text but the ID of the element you looked up. I connected my Nintex Forms Lookup Control to the title column of the list and stored the ID of the looked up element in it. When I know create new elements via PowerShell or via Quick Edit and afterwards open the element in the Nintex Form the Lookup Control is filled as desired.

198597_pastedImage_1.png

198598_pastedImage_2.png

198635_pastedImage_3.png

So I would suggest that you store the ID instead of the text and then change your PowerShell Script in the way that it writes the ID in your text colum. To also get the actual text you wanted to migrate, you can maybe enhance the PowerShell Script to store this values into another column or you just set up a Nintex Workflow for that.

Best regards,

Jan

Badge

Hi Jan,

Thank you for this very clear explanation.

I'm going to try this with our setup. I'll keep you updated.

Greets,

Peter

Badge +8

Hi Peter,

Lookup value is stored in the below format:

<<Lookup List Item ID>>;#<<Lookup List Item Title>>;#<<Lookup List Item ID>>;#<<Lookup List Item Title>>

Example: 32;#School;#38;#Office;#40;#Home

To update a Lookup value either pass the Lookup List Item ID OR pass the string in above format.

Reply