Populate a list based on a selection from another list

I tried the below code:
// Assuming ListA and ListB are the IDs of your list components
const selectedValue = FilteredBy.selectedItem; // Get the selected item from ListA

// Determine the data source for ListB based on the selected index in ListA
let dataSourceForListB;

switch (selectedValue) {
case 'Category':
dataSourceForListB = GetCategory;
case 'Vendor':
dataSourceForListB = GetVendors;
// Add more cases as needed...
dataSourceForListB = []; // Default data source if no match

// Update the data source of ListB
ListBy.items = dataSourceForListB;

It is not populating the ListBY list.

hello, You have post same question in two topics, pls delete another one.

You can't set the value of table directly, here you can use a variable as intermediate for workaround.

Here is a exported app json, you can import it to check incompletion dedtail.
test.json (11.2 KB)

1 Like