search cancel

When using ASLIST with the COLUMN1/COLUMN2 construct, an error occurs in self-service form when the list contains duplicates

book

Article ID: 215883

calendar_today

Updated On:

Products

CA Test Data Manager (Data Finder / Grid Tools)

Issue/Introduction

I have a form that is constructed with ARD (what we are calling "mining form") and generator variables.

There is a variable defined as a dropdown list, which I populate with an ASLIST function.

I was getting strange behavior on the form, when I clicked the dropdown, it would just turn orange, but no error was visible.

I turned on the logging on Chrome and found this exception: (this is not my real SQL result, but a simple case to reproduce this for you)

angular.js:11655 Error: [ngRepeat:dupes] http://errors.angularjs.org/1.3.15/ngRepeat/dupes?p0=item%20in%20suggestionList.items%20track%20by%20track(item)&p1='B'&p2=%7B%22displayText%22%3A%22%20Second%22%2C%22valueText%22%3A%22'B'%22%7D
    at angular.js:38
    at angular.js:24631
    at Object.fn (angular.js:14173)
    at n.$digest (angular.js:14308)
    at n.$apply (angular.js:14571)
    at angular.js:16308
    at e (angular.js:4924)
    at angular.js:5312

 

Since the call referenced "dupes" it made me think to look at my SQL, and i did have an error, which resulted in duplicates.   when I fixed it so no dupes, the error went away and the dropdown box worked.


So here is how to reproduce it:

First Construct a portal form that uses variables exposed via ARD.  I leave that to you.

Make a variable that is a dropdown list (i used multi-select, but shouldn't mattter which type)

For the variable,  here are 3 scenarios for what to put in the variable value:

1. This one works fine,  i have hardcoded the list, but  I have B as duplicate.

@aslist(@list(A,B,C,D,E,B)@)@

In either case, the dropdown works, and displays  A,B,C,D,E    and B appears only once.

In the portal, if I click VALIDATE, it will show me  A,B,C,D,E,B   with green checkmark.

 

2. So adding some complexity, by using the COLUMN1/COLUMN2 option,  this one also works fine

@aslist(@list(FIRST ['A'],Second ['B'],Third ['C'],Fourth ['D'], Fifth ['E'])@)@

I do not have any duplicates here. 

the dropdown will display  FIRST, Second, Third, Fourth, Fifth  in the dropdown

 

3. this is the one that will fail.  in this case i have hardcoded the dupes, but my SQL returned dupes so that is what happened to me.

@aslist(@list(FIRST ['A'],Second ['B'],Third ['C'],Fourth ['D'], Fifth ['E'], Second ['B'])@)@

This is very similar to #1 above, i have B twice, but this time i am using the COL1/COL2 stuff
The portal variable validate is also a green checkmark.

but when i run this form, the dropdown list is throwing that angular error as above.

 

I easily resolved my own SQL issue, but this seems to be some gap in the validation of list ,or not properly handling when the list has duplicates. 

I did experiment with some different variations, and have intermittent strange results.  my simplified example above does show the issue, even though it's not a real-life example.

Environment

Release : 4.9

Component : CA Test Data Manager - Others

Resolution

TDMWeb-4.9.317.0.zip 

The above patch fixed the issue. 

Note - All the duplicate display value and key value will be removed now.

e.g  @aslist(@list(A ['Z'],A ['Y'],A ['X'],B ['X'])@)@

o/p in list could be any one from A ['Z'] OR A['Y'] OR A ['X'] AND B ['X']

A -> Z and B -> X