When using ASLIST with the COLUMN1/COLUMN2 construct, an error occurs in self-service form when the list contains duplicates
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

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 is populated with an ASLIST function.

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

Turned on the logging on Chrome and found this exception: (this is not the real SQL result, but a simple case to reproduce this error)

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" looked at the SQL, and did have an error, which resulted in duplicates.   When the no dupes was fixed, 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.  

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

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

1. This one works fine,  have hardcoded the list, but 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 VALIDATE is clicked, it will show 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'])@)@

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 have hardcoded the dupes, but the SQL returns dupes so that is what happened.

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

This is very similar to #1 above, have B twice, but this time am using the COL1/COL2 stuff
The portal variable validate is also a green checkmark, but when running this form, the dropdown list is throwing that angular error as above.

 

 

 

Environment

Release : 4.9

Component : CA Test Data Manager - Others

Cause

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

Resolution

Patch TDMWeb-4.9.317.0.zip resolves this issue.

This can be downloaded from link:

Test Data Manager (TDM) Support Patches

 

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