cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

List lookup control in repeating section only saves item ID

Jump to solution

Hi all. This is my first post - hope you don't mind if I start with a query. I am not really a developer, so apologies in advance if any of my terminology isn't quite right.

 

I have a repeating section in one of my Nintex forms. Within that repeating section is a list lookup control that pulls in values from a column in an external list. The external column is of the 'single line of text' type.

 

The lookup works just fine when I am inputting data into the form - the data from the external column is displayed in full exactly how I want.

 

However, when I save the form and check the XML output from the repeating section, I notice that only the item ID is saved - not the data from the column itself.

 

Here is an example of the XML I am getting:

 

<WPLookup type="System.String">4</WPLookup>

 

That number 4 is the item ID of the value I want to look up, not the value itself. The value of that field is a string "WP40 - Painting Pete". Any idea how I can get the string and not just the item ID?

 

All info gratefully received

Labels: (2)
Reply
10 Replies
Workflow Hero

Re: List lookup control in repeating section only saves item ID

Jump to solution

You have several possibilities :

  • the easiest one : you can add a field in your repeating section to display the value of the selected item in the lookup field using a calculated value which formula uses the lookup function
  • or you can start a workflow after the item creation/modification which will loop through all the lookup fields of the repeating section XML (using an XPath expression available in the Query XML action). Foreach lookup field, you can extract the item ID. With this item ID, you can get the corresponding title via a Query list action. Then you can do what ever you want with this title. I just advise you not to update the field containing the repeating section XML otherwise the display or edit form of the item displaying the repeating section won't work correctly for the lookup field.

 

Hope this helps

0 Kudos
Reply
Workflow Hero

Re: List lookup control in repeating section only saves item ID

Jump to solution

Hi Poussin/Caroline

What was your formula you used in the calculated value to display the list lookup value?

Thanks,

Jesse

0 Kudos
Reply
Workflow Hero

Re: List lookup control in repeating section only saves item ID

Jump to solution

You can use the following formula to display the text of a list lookup value :

parseLookup(​The reference to your list lookup control, true)

Hope this helps,

Reply
Workflow Hero

Re: List lookup control in repeating section only saves item ID

Jump to solution

Hi

Using the XPath option, what is the string used. For non lookup repeating section fields I use the following:

//Items/Item[<Index>]/<Repeating Section Field Name>

With a lookup field, this brings back the ID number. How do I get the actual field data?

0 Kudos
Reply
Workflow Hero

Re: List lookup control in repeating section only saves item ID

Jump to solution

Hi Joanne,

Sorry for the delay.

If you're in a workflow and trying the get the title of a lookup field, you will have to add a query list action in your workflow to get this information based on the ID extracted using your XPath query.

When storing data from a repeating section, there's only the ID of a lookup field which is kept. When the form is displayed, a query is performed at loading event to get the text value of a lookup field. This is actually because the text value of a lookup field could have changed since the last edition of the form (if the related item of the lookup item has been modified).

Hope this helps

0 Kudos
Reply
Workflow Hero

Re: List lookup control in repeating section only saves item ID

Jump to solution

Oh yes! That makes sense. Thanks Caroline. I'll give that a go. 

0 Kudos
Reply
Workflow Hero

Re: List lookup control in repeating section only saves item ID

Jump to solution

You're welcome

0 Kudos
Reply
Workflow Hero

Re: List lookup control in repeating section only saves item ID

Jump to solution

Hi Caroline,

I have added calculated field and it is added in xml. as i have 5 dropdowns xml data will become huge.

I am not able to xpath to get value.If possible can you please explain step by step how to do it and any sample

0 Kudos
Reply
Workflow Hero

Re: List lookup control in repeating section only saves item ID

Jump to solution

I have added calculated field and it is added in XML. as i have 5 drop downs XML data will become huge.

 

I am not able to xpath to get value.If possible can you please explain step by step how to do it and any sample

0 Kudos
Reply