michaela
Scout

Re: Displaying list lookups as a repeating section or other?

Jump to solution

My original problem and solution above was in the context of Nintex Forms version 2.7.0.0 (SharePoint 2013). I'm now having to revisit this within a Nintex Forms version 4.2.2.0 (SharePoint 2016) environment, and finding that the custom Javascript isn't working correctly. Some quick debugging suggests that the selector for the dropdown list isn't functioning. That is, I'm unable to retrieve the text of the selected value from the dropdown with the following line:

var strState = NWF$("#" + selState + " option:selected").text();

Where selState is defined as the Client ID for the list lookup dropdown.

Can someone point out what may have changed between Nintex Forms versions that prevent this from now working? Thanks in advance!

0 Kudos
Reply
michaela
Scout

Re: Displaying list lookups as a repeating section or other?

Jump to solution

Found a solution as suggested by Marian Hatala‌ in post How to get selected value from 'new' dropdown list in JavaScript. The solution is to change line 6 in my original JavaScript from:

var strState = NWF$("#" + selState + " option:selected").text();

to the following:

var strState = NWF.RuntimeFunctions.parseLookup(NWF$("#" + selState).val(), true);

Hope this helps anyone else with a similar migration problem.

Reply
flocke
Novice

Re: Displaying list lookups as a repeating section or other?

Jump to solution

Hi

I have an issue with this solution, it works all fine with your post. Thank you  But it always add the empty repeating section to(Picture). Is it  possible that we only generete this much fileds as the lookup contains? i have a calulated value field next to the Single Line text box and the value is only visible when i delete the empty repeating section. 

Thank you very much

cheers,

Florian

Reply
michaela
Scout

Re: Displaying list lookups as a repeating section or other?

Jump to solution

You can simply trigger the click() event on the delete row image of the last row after all your rows have been inserted. Referring to the original code above at line 31, add the following line after the closing brace of the while{} loop:

// Remove the last row
NWF$('.repStores .nf-repeater-row:last').find('.nf-repeater-deleterow-image').click();

Hope that helps!

Reply
flocke
Novice

Re: Displaying list lookups as a repeating section or other?

Jump to solution

I tried something similar, but my code doesn't work.  

It works !! Thank you for your help.

cheers,

Reply