cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
corsair266
Frequent Visitor

Powerapps Dictinct function - How to indicate columns name from Combobox.SelectedText

Hi every one, I have Table1 with several column names represented product types

Table 16.jpg

Combobox1: Dropdown list of job Product type. Example "450G"

Combobox2: I use Distinct function to list all related jobs from selected product type Combobox 1.SelectedText 

But problem is, Distinct(Table1, Combobox1.SelectedText) doesn't return the list belong to "450G". 

If i say Distinct(Table1,'Apple' ) - it work fine.

Work.jpg

Does anyone can give idea how to indicate column name in Distinct function from Combobox2.SelectedText?

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @corsair266 ,

 

You could try hard-coded.

You could try this formula on your combo box 2 control.

 

If(Combobox1.Selected.Value="450G",Distinct(Table1,450G),Combobox1.Selected.Value="475A",Distinct(Table1,475A),....,.....)

 

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

4 REPLIES 4
Drrickryp
Super User
Super User

HI @corsair266 ,

Distinct produces a single column table of unique values and renames that column "Result".   BTW: .SelectedText is deprecated and may not be supported in the future.  If 'Allow multiple selections is false in your combobox, and you wanted to filter on a column called "product" for example,  then 

 

Filter(Table1,product=Combobox1.Selected.Result)

 

if the combobox's Allow multiple selections is true, then it would be 

 

Filter(Table1, Combobox1.SelectedItems in product)

 

to filter for several selections in the combobox.  To see how it would work with several comboboxes allowing multiple selections:_1.png

 

corsair266
Frequent Visitor

Dear Drrickryp, thank you for your explain however that is not the point I would expected.  

I explain in the picture below. I want to have combobox 2 shows all jobs regarding product type that is selected from combobox 1.

Thank you in advance

Explain1.png

corsair266
Frequent Visitor

Anyone can help for this issue?

At the moment my Distinct function in combobox 2 doesnt work

v-xiaochen-msft
Community Support
Community Support

Hi @corsair266 ,

 

You could try hard-coded.

You could try this formula on your combo box 2 control.

 

If(Combobox1.Selected.Value="450G",Distinct(Table1,450G),Combobox1.Selected.Value="475A",Distinct(Table1,475A),....,.....)

 

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (3,285)