cancel
Showing results for 
Search instead for 
Did you mean: 
Masroor
Nintex Newbie

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

I am cascading Lookup list.

P1.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.

P2.png

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

P3.png

P5.png

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

P4.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.

Labels: (1)
0 Kudos
Reply
4 Replies
Nintex Employee
Nintex Employee

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

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.
0 Kudos
Reply
Masroor
Nintex Newbie

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

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.P6.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.

0 Kudos
Reply
Automation Master
Automation Master

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

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

0 Kudos
Reply
Masroor
Nintex Newbie

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

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

 

0 Kudos
Reply