Question
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
IP Australia
AU
Last activity: 16 Oct 2018 12:03 EDT
How to populate distinct values in Dropdown while using D_pyUserWorkList data page to populate dropdown
Hi,
I have a requirement to show distinct values in drop down which is sourced from D_pyUserWorkList data page column, I am already getting unique records only from report definition. but, I am not able to find a way to show distinct values from DP Column.
Do you have any solution to achieve this?
Thanks,
Mohammad.
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
IP Australia
AU
used javaScript to filter the duplicate values and populate the data page to refer on dropdown.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689979000/321c2db9-adc7-4c43-8f1d-d6a84c486e5a.jpg?itok=mEyE0RUn)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689979000/321c2db9-adc7-4c43-8f1d-d6a84c486e5a.jpg?itok=mEyE0RUn)
Pegasystems Inc.
US
Hi Mohammad,
The Data Page D_pyUserWorkList is sourced with the pyUserWorkList report definition and the parameters passed in the Data Page are:
UserId -> pxRequestor.pyUserIdentifier
WorkGroup -> pyDisplayHarness.pyActiveWorkGroup
When i ran the report definition and data page, i can see the same results in both the executions.
Could you share the screenshots of both the results, along with the screenshots of configuration for your Drop down list box.
Regards
Mahesh
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
IP Australia
AU
Hi Mahesh,
I don't have problem with report definition and data page population, But the problem is to load distinct values on dropdown. lets say I am referring pxurgencyassign propery value in dropdown from 'D_pyUserWorkList', I am getting same urgency number "10" displayed 5 times in dropdown as I have 5 records in datapage with 10 as urgency. but I need to display value 10 only 1 time in dropdown.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689979000/321c2db9-adc7-4c43-8f1d-d6a84c486e5a.jpg?itok=mEyE0RUn)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689979000/321c2db9-adc7-4c43-8f1d-d6a84c486e5a.jpg?itok=mEyE0RUn)
Pegasystems Inc.
US
Hi Mohammad,
Dropdown list will just display the data what you source in the Page List, so you have to remove the duplicate records in D_pyUserWorkList page list based on pxUrgencyAssign property before you source it to drop down. To remove the duplicate records in a page list based on a property you can have a look into the sample usecase as attached.
Hope this will help you to achieve your requirement.
Regards
Mahesh
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
IP Australia
AU
Thank you Mahesh, I don't think it solve my issue. this is altering the data page, I should not alter the DP, as even my urgency values are same for some records, records of DP are not same. I need all records to display on user assignments. at the same time, I need to populate refinsname of DP on other dropdown column. if I alter DP, i wont get correct results to show on refinsname dropdown.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689979000/321c2db9-adc7-4c43-8f1d-d6a84c486e5a.jpg?itok=mEyE0RUn)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689979000/321c2db9-adc7-4c43-8f1d-d6a84c486e5a.jpg?itok=mEyE0RUn)
Pegasystems Inc.
US
Hi Mohammad,
If you want both duplicate and unique records then you can copy the original page list into the Temporary Page List and then apply my usecase to remove the duplicates in the Temporary Page List. Now you can use original page list and unique page list(temporary) for both the requirements., because i don't see any option to hide/remove remove duplicates at the Dropdown control level so you need to eliminate the duplicates before you source the data page to drop down control.
Hope this might help you.
Regards
Mahesh
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
IP Australia
AU
So, if I have 10 dropdowns to display distinct values, do I have to create 10 temp pages and display the values?
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689979000/321c2db9-adc7-4c43-8f1d-d6a84c486e5a.jpg?itok=mEyE0RUn)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689979000/321c2db9-adc7-4c43-8f1d-d6a84c486e5a.jpg?itok=mEyE0RUn)
Pegasystems Inc.
US
@Mohammad, in your case the records are not duplicate but the specific column has the duplicate values and you want to use this column for the drop down list. Also, you need both the original page list and the records which doesn't have the duplicate values for pxUrgencyAssign field. So at the bottom line of the above requirement you need to eliminate the duplicate values of pxUrgencyAssign field from the original page list using above code or removeDuplicatesFromList ootb RUF, as i don't see any option to remove duplicates at the UI level.
-
Subham Singh Gerrit Smink
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689974000/21fd5cbe-8dec-4d96-904a-b5bce9b8f504.jpg?itok=8_bUnK7C)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689974000/21fd5cbe-8dec-4d96-904a-b5bce9b8f504.jpg?itok=8_bUnK7C)
Pegasystems Inc.
IN
If I understand your usecase correctly, you're trying to achieve filtering using a dropdown control. If you wish to continue using dropdwon, you'll have to create as many distinct lists as the number of dropdowns. Alternatively, you can use grid filters which already does this job of identifying unique values and let the users filter based on the filer selection.
Accepted Solution
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
IP Australia
AU
used javaScript to filter the duplicate values and populate the data page to refer on dropdown.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689979000/321c2db9-adc7-4c43-8f1d-d6a84c486e5a.jpg?itok=mEyE0RUn)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689979000/321c2db9-adc7-4c43-8f1d-d6a84c486e5a.jpg?itok=mEyE0RUn)
Pegasystems Inc.
US
@Mohammad, it would be helpful to other users if you share your custom code for get the distinct values from page list.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
IP Australia
AU
if using from mobile:
Created a data page to populate the data page on dropdown.
function D_DropDown( dpPage, params ){
var cc=pega.u.ClientCache;
var DropDownpg = dpPage.put( "pxResults",[] );
var WLIter = cc.find("D_WorkList.pxResults").iterator();
var temp = new Array();
while(WLIter.hasNext()){
var WLPg = WLIter.next();
var tempCSName= WLIPg.get("pxurgencyassign").getValue();
var isCSThere = temp.indexOf(tempCSName);
if( isCSThere == -1)
{
WLPg.put("CSName",tempCSName);
DropDownpg.add().adoptJSON(WLPg.getJSON());
temp.push(tempCSName);
}
}
}
if using from desktop:
if using from mobile:
Created a data page to populate the data page on dropdown.
function D_DropDown( dpPage, params ){
var cc=pega.u.ClientCache;
var DropDownpg = dpPage.put( "pxResults",[] );
var WLIter = cc.find("D_WorkList.pxResults").iterator();
var temp = new Array();
while(WLIter.hasNext()){
var WLPg = WLIter.next();
var tempCSName= WLIPg.get("pxurgencyassign").getValue();
var isCSThere = temp.indexOf(tempCSName);
if( isCSThere == -1)
{
WLPg.put("CSName",tempCSName);
DropDownpg.add().adoptJSON(WLPg.getJSON());
temp.push(tempCSName);
}
}
}
if using from desktop:
Write a Data transform to load data page with parameters,
Loop through the source page list, Append the values from source to primary page if parameter mached with a when condition "!(@Utilities.IsInPageList(parameter,"property",pagelist))".