I have a user filter with multiple dropdown and the drop down contains duplicate names of amendment but their application type and Line of business is different so there are duplicate names . As this is multiple dropdown if we select one duplicate name another duplicate name is also getting selected thats fine , but when I deselect one its not deselecting both, aby idea how to handle this
In the above picture I selected blood , but if I deselect one blood , its not getting deselecting unless I click on "cross" button in dropdown
a!localVariables( local!i18nInterfaceData: rule!INZ_I18N_loadBundlesFromFolder( bundleFolder: cons!INZ_CONS_INTERFACE_COMPONENT_INTERNATIONALIZATION_FILES ), a!recordFilterList( name: rule!INZ_I18N_displayLabel( i18nData: local!i18nInterfaceData, bundleKey: cons!INZ_CONS_TXT_INTERFACE_COMPONENT_INTERNATIONALIZATION & ".amendment" ), options: a!localVariables( local!fieldValues: rule!UWG_QR_fetchAmendmentMaster( fields: { 'recordType!{d03af89a-4736-443f-aeec-958be8783ddf}UWG Amendment Reference Master.fields.{e9e1cb2d-be01-4514-96e3-48a7a00bc1c7}amendmentMasterId', 'recordType!{d03af89a-4736-443f-aeec-958be8783ddf}UWG Amendment Reference Master.fields.{550a0445-1938-4c98-99e8-2e5387fbebd2}nameEnglish', 'recordType!{d03af89a-4736-443f-aeec-958be8783ddf}UWG Amendment Reference Master.fields.{f239d136-06ca-415b-9dba-5b042d950340}nameFrench' }, /*pagingInfo: rule!CL_pagingInfoAllRecordType(),*/ pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 5000, sort: a!sortInfo( field: if( userlocale(loggedInUser()) = cons!CL_CONS_TXT_LOCALE_EN_US, 'recordType!{d03af89a-4736-443f-aeec-958be8783ddf}UWG Amendment Reference Master.fields.{550a0445-1938-4c98-99e8-2e5387fbebd2}nameEnglish', 'recordType!{d03af89a-4736-443f-aeec-958be8783ddf}UWG Amendment Reference Master.fields.{f239d136-06ca-415b-9dba-5b042d950340}nameFrench' ), ascending: true() ) ), returnRecordType: true, returnOnlyActiveData: true ), a!forEach( items: local!fieldValues, expression: a!recordFilterListOption( id:fv!index, name: if( userlocale(loggedInUser()) = cons!CL_CONS_TXT_LOCALE_EN_US, fv!item['recordType!{d03af89a-4736-443f-aeec-958be8783ddf}UWG Amendment Reference Master.fields.{550a0445-1938-4c98-99e8-2e5387fbebd2}nameEnglish'], fv!item['recordType!{d03af89a-4736-443f-aeec-958be8783ddf}UWG Amendment Reference Master.fields.{f239d136-06ca-415b-9dba-5b042d950340}nameFrench'] ), filter: a!queryFilter( field: 'recordType!{bf842322-0f8a-429a-873a-f0d69ec9d438}UWG Amendment Reference.fields.{903a1a45-08d8-48a9-899c-d6750cd0d8f6}amendmentMasterId', operator: "=", value: fv!item['recordType!{d03af89a-4736-443f-aeec-958be8783ddf}UWG Amendment Reference Master.fields.{e9e1cb2d-be01-4514-96e3-48a7a00bc1c7}amendmentMasterId'] ) ) ) ), defaultOption: null, isVisible: true, allowMultipleSelections: true ) )
Discussion posts and replies are publicly visible
Do all the Blood entries have the same amendmentMasterId or different amendmentMasterId values?If Same Id : Use amendmentMasterId as the id.If Different Ids: You need to group by name first, then create one filter option per unique name with an array of Ids.
I want to see all the duplicate names in the dropdown as per business, only thing I need it has to deselect when I deselect it , currently its not deselecting
The code you provided uses amendmentMasterId as the filter selection, and the dropdown displays either nameEnglish or nameFrench. This means that if the ‘Blood’ option appears twice, both entries share the same amendmentMasterId. That’s why selecting ‘Blood’ selects both.
amendmentMasterId
nameEnglish
nameFrench
From my experience, if duplicates exist, you can’t unselect just one—it will reselect both (with a slight delay). You need to manually unselect both to clear the selection.
The fix is to remove duplicates from the list. Based on your data, the easiest way would be to query dropdown values from the UWG Amendment Reference record, which doesn’t contain duplicate amendmentMasterId values. Currently, you’re pulling from the amendmentMaster record, which can include multiple duplicates of the same amendment type. I also noticed ‘Brain or nervous system’ duplicated there. If this isn’t addressed, as more records are added, your filter will continue to grow with duplicates.
The downside is that your list will contain all the values avalaible in UWG Amendment Reference regardless if it is used or not if you prefer to only see options that are in the data then use grouping to ensure you don't get any duplicates.