cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Can we compare dropdown values in Repeating section?

Jump to solution

Hi,

Can we compare dropdown values in Repeating section?

I would like to compare the dropdown values in Repeating section to avoid duplication records. Can we use compare validator for Repeating section?

Could someone maybe help me out?

Thanks,

Swap

Labels: (2)
0 Kudos
Reply
8 Replies
Workflow Hero

Re: Can we compare dropdown values in Repeating section?

Jump to solution

Hi,

Just found below solution on internet.

1. insert below javascript to Form Setting Custom Javascript section

function allValuesUnique(Item)

{

var allValuesUnique = true;

debugger;

NWF$.each(Item, function (key1, value1) {

NWF$.each(Item, function (key2, value2) {

if (key2 != key1 && value2 == value1)

{

allValuesUnique = false;

}

});

});

return allValuesUnique;

}

2. Create a new rule based on Repeater section

3. Select Rule Type - Validation

4. Set Condition - !allValuesUnique(<Dropdown Control Name>)

Thanks,

Swapnil

0 Kudos
Reply
Workflow Hero

Re: Can we compare dropdown values in Repeating section?

Jump to solution

Hi, The script is not working for me, is this working for you?

0 Kudos
Reply
Workflow Hero

Re: Can we compare dropdown values in Repeating section?

Jump to solution

Yes, all runs fine. Have you created rule and specified name of the dropdown in it?

Swap

0 Kudos
Reply
Workflow Hero

Re: Can we compare dropdown values in Repeating section?

Jump to solution

Have you tried below solution again?

0 Kudos
Reply
Workflow Hero

Re: Can we compare dropdown values in Repeating section?

Jump to solution

That didn't work for me probably because my dropdown is a lookup value from another list

0 Kudos
Reply
Workflow Hero

Re: Can we compare dropdown values in Repeating section?

Jump to solution

I think this solution should work for lookup field dropdown value as well.

0 Kudos
Reply
Workflow Hero

Re: Can we compare dropdown values in Repeating section?

Jump to solution

I will again try and will let you know If I am getting any error

0 Kudos
Reply
Not applicable

Re: Can we compare dropdown values in Repeating section?

Jump to solution

Can you show the complete javascript code and key1,key2 reference to which field.

0 Kudos
Reply