How to remove duplicate values when cascading Lookup List in Nintex 2013

  • 26 September 2019
  • 4 replies
  • 20 views

Badge +2

I am cascading Lookup list.

4737i68B1F95D7DCA2236.png

ActvityTypePST Lookup list has duplicate value. If i select craft item from Craft Lookup List then ActivityTypePST will display repeated value as shown in figure below.

4738i75F510AE570CA8EF.png

To remove duplicate values from ActivityTypePST i have used Nintex javascript as shown in figure below.

4739i045478C75E0D694D.png

4741i0A56F9A288F043DD.png

when form loads then on that time ActivityTypePST lookup list will display unique values as shown in below screen.

4740iCD74288AAE929B2B.png

But when i select craft items then cascading items will come in ActivityTypePST with repeated value.

In javascript i am trying to remove duplicate value on change function but it's not working.

Please help me to resolve this issue.I am trying since 2 days but no luck.


4 replies

Userlevel 6
Badge +22
Hi,

Unfortnately my Javascript isnt that great but I was wondering why you would have duplicate data if you are doing cascading drop downs.
If the lookup lists are setup correctly there should be no duplicates.
Badge +2

Hi Simon,

Thanks for your reply. The SP List name Activity Type has 6 columns and one lookup column.

I am cascading from one lookup column to 6 columns. You can see below screen.4811i02EFE2451EAA95C3.png

Values are repeating only because of this scenario.I have mark the data for better understanding.

I am using lookup list for all these columns in nintex form 2013 to cascade.

Please help me.

Badge +12

Instead of having different lists for list lookup, I'm doing this with just 1 lists and some views. Follow below detailed steps for this approach:

 

  • Create a list (i.e. "One List Only") using custom list template
  • Create some SLT columns now e.g. Cat1, Cat2, Cat3, Cat4. These columns will be our lookup column on the form
  • Create 2 choice columns (choices will be No, Yes, keep default No) and name it "UniqueCat1" & "UniqueCat2"
  • Find all unique values in Cat1 column and set UniqueCat1 as "Yes" & rest as "No"
  • Find all unique values in Cat2 for each unique values of Cat1 (I know it's little confusing... lol) and set UniqueCat2 as "Yes" & rest as "No"
  • Create 2 Views now:
    • UniqueCat1View - Keep only Cat1 & UniqueCat1 columns, filter it UniqueCat1 = Yes, sort by Cat1 in ascending order
    • UniqueCat2View - Keep Cat1, Cat2 & UniqueCat2 columns, filter it UniqueCat1 = Yes, sort by Cat1 & then Cat 2 in ascending order
  • Now create 2 calculated list columns:
    • lstcol_calc_Cat1_Cat2:- Use formula =[Cat1]&"_"&[Cat2]
    • lstcol_calc_Cat1_Cat2_Cat3:- Use formula =[Cat1]&"_"&[Cat2]&"_"&[Cat3]
  • Now on the form add lookup control for Cat1 and Name it as "ctrl_lkup_cat1". Add others lookup controls and name them with same naming convention as for Cat1.
  • Now add 2 calculated controls for Cat3 & Cat4 filters (I usually put them in panel and hide the panel using 1<2 rule), functions will be (and make sure they DO recalculate formula in all 3 modes):
    • parseLookup(ctrl_lkup_cat1)+"_"+parseLookup(ctrl_lkup_cat2)
    • parseLookup(ctrl_lkup_cat1)+"_"+parseLookup(ctrl_lkup_cat2)+"_"+parseLookup(ctrl_lkup_Cat3)
  • For Cat1:
    • Select "One List Only" as Source List
    • Source View - UniqueCat1View
    • List Column Name Cat1
  • For Cat2:
    • Select "One List Only" as Source List
    • Source View - UniqueCat2View
    • List Column Name Cat2
    • Filter it:
      • By control's value
      • Where field Cat1
      • Filtered by control - ctrl_lkup_cat1
  • For Cat3:
    • Select "One List Only" as Source List
    • Source View: All Items (from now onwards we will use this view for all other cascades)
    • List Column Name: Cat3
    • Filter it:
      • By control's value
      • Where field: lstcol_calc_Cat1_Cat2
      • Filtered by control: ctrl_calc_Cat1_Cat2
  • For Cat4:
    • Select "One List Only" as Source List
    • Source View: All Items
    • List Column Name: Cat4
    • Filter it:
      • By control's value
      • Where field: lstcol_calc_Cat1_Cat2_Cat3
      • Filtered by control: ctrl_calc_Cat1_Cat2_Cat3
  • Now if you have more columns then all you need is:
    • Calculated column in a list
    • Calculated control on the form
    • Follow the same steps we did for Cat3 & Cat4

 

Let me know if you have any questions

Badge +2

Hi Kunal,

Thanks for your reply and sorry for late response.I didn't understand the below scenario.

--> Find all unique values in Cat1 column and set UniqueCat1 as "Yes" & rest as "No"

How i'll find the unique values in Cat1 column.

How to set UniqueCat1 as "Yes" & rest as "No".

I am confused.Could you please provide me with the screen how to achieve this?

Thanks,

Masroor

 

Reply