cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
doironjp
New Member

Using the Combobox selectedItems as text for other lists

Hello, 

 

This is quite the beginner's question, but I would just like to use the SelectedItem in my ComboBox (maybe extract it?) so that I can use it to power "Distinct" searches in other DropDown lists. 

 

Specifically, I am trying to reference the SelectedItem in this formula : 

 

Sort(Distinct(Filter("List1", Name2=COMBO.SELECTED.FIELD),Name1),Result)

 

Thank you and I will be glad to offer more details if need be! 

1 ACCEPTED SOLUTION

Accepted Solutions
doironjp
New Member

Thanks to all your answers I found out how to make it work : 

 

Sort(Distinct(Filter('List1'; Nom2=COMBO.Selected.Name2); Name1); Result)

 

View solution in original post

7 REPLIES 7
RandyHayes
Super User
Super User

@doironjp 

SelectedItems is just a property that contains a table of records that match the Items property of the control and have been selected.

What is it that you want to use the in regard to Distinct?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
rubin_boer
Super User
Super User

hi @doironjp the combobox has a field that's mapped to it. a label can refer to that field such as yourComboBox.Selected.Field such as yourComboBox.Selected.Value this will display the selected items field/column Value.

 

It becomes a bit more tricky with multiple selected items

 

Hope it helps

R

hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.
doironjp
New Member

Hello! Thanks a lot for the fast answers. 

 

I am trying to reference the SelectedItem in this formula : 

 

Sort(Distinct(Filter("List1", Name2=COMBO.SELECTED.FIELD),Name1),Result)

RandyHayes
Super User
Super User

@doironjp 

Your syntax is wrong.  Are you using a language that needs your parameters to be separated by a comma or a semicolon?

 

Should be either:

   Sort(Distinct(Filter(List1, Name2=COMBO.Selected.FIELD), Name1), Result)

Or

   Sort(Distinct(Filter(List1; Name2=COMBO.Selected.FIELD); Name1); Result)

 

Note, the above formulas will only provide filtering on ONE item.  If you want to filter on multiple selections, then:

   Sort(Distinct(Filter(List1, Name2 in COMBO.SelectedItems.FIELD), Name1), Result)

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

You are right my syntax was all messed up since I'm using the French version and was trying to "translate" it sorry. 

 

I have tryed the following but it doesn't seem to yield any result :

 

   Sort(Distinct(Filter(List1; Name2=COMBO.Selected.FIELD); Name1); Result)

RandyHayes
Super User
Super User

@doironjp 

Okay...semicolons it is then.

 

What is the Items property of your combobox?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
doironjp
New Member

Thanks to all your answers I found out how to make it work : 

 

Sort(Distinct(Filter('List1'; Nom2=COMBO.Selected.Name2); Name1); Result)

 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (1,350)