Question

How to populate distinct values in Dropdown

Hello team,

I have a requirement to show distinct values in a dropdown.Could you guide me how to achieve this. I have followed below two methods to populate the values in dropdown and able to see the data in dropdown. This is showing all the values.:

Method 1:
I have created a data page with structure as list.
Created an Activity in Code-Pega-List class using Obj-Browse method and referred the above Data Page under Page Name.
Refered the above Activity in the data page under source -> Activity.
In Dropdown- settings - General - List Source -Type -DataPage - Referred the above Data page.

Method 2 :
Created an Activity in work class using Obj-Browse method.
Referred the above activity in Dropdown- settings - General - List Source -Type -Clipboard page.

Now, how and where i need to control the dropdown to get only distinct values.

Appreciate your kind support.

***Moderator Edit: Vidyaranjan| Updated Categories***

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

Comments

Keep up to date on this post and subscribe to comments

Pega
January 6, 2017 - 6:51am

Hi NagaRamesh,

use @IsInPageList(.pzInsKey,"pzInsKey", myPageList.pxResults) to skip the duplicates while building the dropdown value in the page list.

Regards,

Supraja

January 6, 2017 - 10:33am

Hello NagaRamesh,

You can create the ReportDefinition with source column and check the Remove duplicate rows option to load unique values. Now refer the RD as datepage source. Refer attached screen print remove duplicate configuration.

Otherwise refer the pyRemoveDuplicatesFromPagelist and use same code in activity as java step and remove the duplicates from given pagelist.

 

Regards,

Praveen

January 12, 2017 - 6:20am
Response to PraveenMankala

Hi Praveen,

Still not able to obtain distinct values in dropdown list using report definition as I followed all the steps as it is mentioned in the attatchments.

Regards,

Prashant

January 12, 2017 - 10:27am
Response to PrashantP0819

Hi Prashant,

Can you please share the complete use case along with the test result for us, so that it can be helpful in our further investigation to find the root cause. Also share the PRPC version you are using. Thank you.

Regards,

Mahesh

Pega
January 6, 2017 - 6:10pm

Hi,

The Dropdown can be configured using a data page / report definition / clipboard page. 

Please refer to DesignerStudio -> User Interface -> UI Gallery -> Dropdown examples.

In terms of populating distinct values in Dropdown, I second Praveen's opinion, using Report Definition (with "Remove duplicate rows" checkbox checked) is the best choice. You can create a data page with Report Definition as its data source. 

 

June 8, 2017 - 5:41am
Response to SusanLiu

Hi All,

As far as i know, 'Remove duplicates rows' in RD will work for the above requirement if there is only column in RD, if there are more than on column, it will remove duplicates with the combination of all columns treating as a single row and will remove only if the same combination exists.

Let's say 

Col 1    Col 2   Col 3

AAA     BBB    CCC

AAA    CCC    BBB

CCC   AAA     BBB

In this case though we have duplicates in column 1 and column 3, it will not remove duplicates as the three column combination is unique. If we have to remove duplicates in each column, how can we achieve this?

Please correct me if am wrong.

Thanks,

Srikanth