cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JR-BejeweledOne
Super User
Super User

Dataverse Table view with distinct values

I need to set a combobox in my Teams Powerapp with distinct values from a Dataverse table text column.   I have been unsuccessful so far.   I thought maybe the solution would be to use a view and have the view only show a list of distinct items, but don't know how I would accomplish this.

 

I do have a view to use for this.     None of the different combinations I have tried actually result in the combobox showing any items.  The TeamName column is the first in the list of field in the combobox property dialog.

I don't have any errors, however there is nothing showing in the combobox.   I could use a dropdown but it doesn't give me access to any of the other columns if I do that.

 

Distinct(Filter(OnCallSchedules, 'OnCallSchedules (Views)'.Teams), TeamName).Result
Distinct(Filter(OnCallSchedules, 'OnCallSchedules (Views)'.Teams), TeamName)
Distinct(OnCallSchedules, TeamName)
Distinct(OnCallSchedules, TeamName).Result

 

emptycb.png



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
5 REPLIES 5
JR-BejeweledOne
Super User
Super User

I thought I had it resolved.   I needed to add the Result field to the list of fields and move it to be the first field in the list.  But I don't have any access now to the other data.

 

 

Sort(Distinct(OnCallSchedules, TeamName).Result, Result, SortOrder.Ascending)

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
Prakash4691
Solution Specialist
Solution Specialist

@JR-BejeweledOne ,

 

Try below formula,

 

Filter(Distinct('Test 1S',Name), 'Test 1S (Views)'.'Active Test 1S')

 

If it answers your question, kindly give kudo and accept it as solution.

 

 

Regards,

Prakash

davipilot
Frequent Visitor

@JR-BejeweledOne try this ...

Distinct(Filter(OnCallSchedules, Teams),TeamName).Result

 

Distinct(Filter(OnCallSchedules, 'OnCallSchedules (Views)'.Teams), TeamName).Result

 

Essentially it would look like:  Distinct(Filter(Table,View),Column).Result

snehal_dhane
Frequent Visitor

Distinct( Table, Formula )

  • Table - Required. Table to evaluate across.
  • Formula - Required. Formula to evaluate for each record.

1.Insert a button control, and set its OnSelect property to this formula.

2.Select the button while holding down the Alt key.

The formula is evaluatd and the collection is created which you can show by selecting in the formula bar.

3.Insert a data table control, and set its Items property to this formula.

4.Use the Edit fields link in the data table's properties pane to add the Result column

5.First( Sort( Distinct( , ), Result ) ).Result

This formula sorts the results from Distinct with the sort function, takes the first record from the resulting table with the ffunction, and  first extracts the Result field to obtain just the country name.

 

snehal_dhane

Thank You

 

That works except I don't have access to the other data in the table, which I need.   It's not a huge thing, I am just trying to make the app a little better, but this isn't going to work the way I want it to.



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,861)