Posted: 5 Oct 2017 11:25 EDT Last activity: 16 Oct 2018 12:03 EDT
How to populate distinct values in Dropdown while using D_pyUserWorkList data page to populate dropdown
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?
**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.
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.
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.
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.
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.
@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.
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.