cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
JesseHall
Level: Power Up

Combobox SelectedItems Lookup to table

Hi guys, I've been researching this for some time and can't seem to find the right solution. Basically what I'm trying to do is do a lookup for each (ForAll) selected item in Combobox1 and return the table to Dropdown1 with corresponding values.

Ex: Combobox1.Items = Column1(1,2,3,4,5.... etc), the selecteditems = 1,2,3 from Column1 which would then lookup those values from another table with Column1ref(1,2,3,4,5.... etc) and Column2(A,B,C,D,E.... etc). I want to return those table values to the dropdown/table so the Dropdown1.items = A,B,C.

This is the line I've been trying. Dropdown1.items =

ForAll(Combobox1.SelectedItems, LookUp('Lookuptable', Column1ref = Combobox1.Selected.Column1, Column2))

If I select 1,3,5 in Combobox1, it returns 5,5,5 to Dropdown1, and if I use SelectedItems instead of selected,

ForAll(Combobox1.SelectedItems, LookUp('Lookuptable', Column1ref = Combobox1.SelectedItems.Column1, Column2))

it returns 1,1,1 to Dropdown1.items.

If anyone can explain what is wrong, i'd greatly appreciate it!


 

 


Accepted Solutions
KroonOfficeSol
Level 10

Re: Combobox SelectedItems Lookup to table

@JesseHall

 

You can't use the ForAll() formula for this. On DropDown1 you should use the Filter() formula. Then take this formula:

Filter('Lookuptable', Column1ref in Combobox1.SelectedItems.Column1)

I didn't test this, so I don't know for sure if it works on multiple selecteditems. I should because I think you get back an one column table off the selected items. Let me know if it works.

 

Hope this helps.

Paul

 


All Replies
KroonOfficeSol
Level 10

Re: Combobox SelectedItems Lookup to table

@JesseHall

 

You can't use the ForAll() formula for this. On DropDown1 you should use the Filter() formula. Then take this formula:

Filter('Lookuptable', Column1ref in Combobox1.SelectedItems.Column1)

I didn't test this, so I don't know for sure if it works on multiple selecteditems. I should because I think you get back an one column table off the selected items. Let me know if it works.

 

Hope this helps.

Paul

 

JesseHall
Level: Power Up

Re: Combobox SelectedItems Lookup to table

@KroonOfficeSol
Thanks! I ended up using this

Filter(ShowColumns('Lookuptable', "Column2", "Column1ref") , Column1ref in ComboBox1.SelectedItems.Column1)

So the dropdown will grab the first column automatically (Column2) instead of grabbing another column that has unneeded information. It works that way, but if there's a better way of selecting the specific column after filter, let me know, thank you!

KroonOfficeSol
Level 10

Re: Combobox SelectedItems Lookup to table

@JesseHall

When you only need Column2 you could probably do this:

Filter('Lookuptable', Column1ref in ComboBox1.SelectedItems.Column1).Column2

Paul

JesseHall
Level: Power Up

Re: Combobox SelectedItems Lookup to table

Thanks, I knew there was a simple solution to it.