Suppose I have two datasets A and B and their Data eg. List (Field Name). Kindly see below images.
Kindly help me to eliminate/do not display/filter option in DATA_B dropdown comparing similar option through code. Any help in regard will be helpful. Thanks in advance. : )
Allow me to show another way of doing this, assuming that your dropdowns are manually connected instead of coded.
//Function that filters repeated items from dropdowns const filter = (list, listToFilter) => { return listToFilter.filter(({ label }) => !list.some(item => item.label === label)) } $w.onReady(async () => { //Wait for the dataset A to be ready $w('#datasetA').onReady(() => { //Wait for the dataset B to be ready $w('#datasetB').onReady(() => { //Get the dropdown values const dd1 = $w('#dropdown1').options const dd2 = $w('#dropdown2').options //Filter the values const filteredDD = filter(dd1, dd2) //Feed them to the dropdown that needs filter $w('#dropdown2').options = filteredDD }) }) })
Best regards.