cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gelos
Post Partisan
Post Partisan

undefined

Hi guys,

Please help me.

I am using this function

...................................................................

Distinct(
Filter(
tablname,
1stcoumnoftable= ComboBox1_4.Selected.Result
),
2ndcolumvalue
)

..................................................................................................

Now combobox show 2nd column value. but I want display two value

Ex:

2nd column value is name it has phone number . phonenumber saved in another table such table has 2nd column name value how to retirve phone number and show name with phone in combobox.

Please help me

@Mike8 

@WarrenBelz 

@RandyHayes 

@Pstork1 

@v-xiaochen-msft 

@timl 

@BCLS776 

@Nogueira1306 

@v-bofeng-msft 

@gabibalaban 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Gelos 

Yes, so the formula I provided will give you what you want.

In context of your example...

ForAll(
    Distinct(
        Filter(Table1,
            country = ComboBox1_4.Selected.Result
        ),
        code
    ),
    {code: Result,
     name: LookUp(Table2, code=Result, name)
    }
)

 

 

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

View solution in original post

7 REPLIES 7
RandyHayes
Super User
Super User

@Gelos 

Distinct is going to return a distinct list of the values in your 2ndcolumnvalue column.

The problem is - nothing is related to it.

 

Example, if you have a directory list of people in an organization and the list contains a department column.  If you "Distinct" the department to get a list of departments and then say "I want to show the persons phone number with the department" - What person??  If there are 10 people in a department, which one would you show?

 

So what is the relationship between the distinct value and other records?  And, how can you narrow it down to just one?

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

I have 2column value in another table. it is unique. So I want to get the value another particular column using the unique value (2nd column value) and show the 2nd column value and the particular column value in drop down

RandyHayes
Super User
Super User

@Gelos 

Not entirely following what you are stating, but it sounds like each unique/distinct value of the first table has another single value in another table and you want to display both in the dropdown.

 

I am not sure what other values you want from your dropdown, but at the minimum, your formula would be something like this:

 

ForAll(
    Distinct(
        Filter(tablname,
            1stcolumnoftable = ComboBox1_4.Selected.Result
        )
    ),
    {1stcolumnoftable: Result,
     2ndcolumnvalue: LookUp(otherTable, someColumn=Result, 2ndcolumnvalue)
    }
)

 

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

Table 1

country    code

Aus          001

US           001

IN            002

 

Table 2

code  name

001   jio

002   Reliance

 

Now I get value from table using contry distinct and filter function. it show  code value now I want name of code. Then I want to display code as a primary text, name as secondry text.

 

RandyHayes
Super User
Super User

@Gelos 

Yes, so the formula I provided will give you what you want.

In context of your example...

ForAll(
    Distinct(
        Filter(Table1,
            country = ComboBox1_4.Selected.Result
        ),
        code
    ),
    {code: Result,
     name: LookUp(Table2, code=Result, name)
    }
)

 

 

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

Thank you so much. It works, but the code value is not ascending order. What should I do for that.

RandyHayes
Super User
Super User

@Gelos 

You can sort on that column.

Sort(
    ForAll(
        Distinct(
            Filter(Table1,
                country = ComboBox1_4.Selected.Result
            ),
            code
        ),
        {code: Result,
         name: LookUp(Table2, code=Result, name)
        }
    ),
    code
)
_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,303)