web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Collections Distinct R...
Power Apps
Answered

Collections Distinct Result Combo Box And A Lookup Dropdown

(0) ShareShare
ReportReport
Posted on by 301

Hi Guys,

 

I Have a piece of code that's run when the app is Onstart that collects two columns from three datasources (Sharepoint Lists) and combines them into one collection. I.e

 

If(
 Connection.Connected,
 ClearCollect(
 colNames,
 {Name: ""}
 );
 Collect(
 colNames,
 ShowColumns(
 'Team Records',
 "Name",
 "EmploymentStatusType"
 )
 );
 Collect(
 colNames,
 ShowColumns(
 'Visitors Records',
 "Name",
 "EmploymentStatusType"
 )
 );
 Collect(
 colNames,
 ShowColumns(
 'Contract Team Records',
 "Name",
 "EmploymentStatusType"
 )
 )
)

 

I then have a dropdown that displays the all the names using the Distinct Function in the Items i.e

 

SortByColumns(Distinct(colNames, Name),"Result")

 

I wish to have another dropdown that Looks up the Name and Shows me the employementstatus results from the Name,

 

Normally i use the code (CBTeaMem is a Combobox name)

 

LookUp(colNames, "Name" = CBTeaMem.Selected.Name, EmploymentStatusType)

 

However since i have used the Distinct Code to Alphabeticallise the first Combobox i have to use Results? however i cannot get it too work with all the combinations i have tried.

 

Could someone help me writs the Lookup code so i can auto fill a dropdown or text label from the users previous comboboxes choice?

 

Categories:
I have the same question (0)
  • BCLS776 Profile Picture
    8,994 Moderator on at

    Try this LookUp():

    LookUp(colNames, "Name" in Concat(CBTeaMem.SelectedItems,Result," "), EmploymentStatusType)

     

    Hope that helps,

    Bryan

  • ShaneITAutomate Profile Picture
    301 on at

    @BCLS776 wrote:

    Try this LookUp():

     

    LookUp(colNames, "Name" in Concat(CBTeaMem.SelectedItems,Result," "), EmploymentStatusType)

     

     

    Hope that helps,

    Bryan


    Cheers Bryan for helping however the code doesnt work.. Even if i modify it in every way i.e selecteditems to selected.result?

  • Verified answer
    v-albai-msft Profile Picture
    Microsoft Employee on at

    Hi @ShaneITAutomate ,

    Since you want to display the corresponding employementstatus results based on the provious selection, you shouldn't use a dropdown. Instead, try to use a label and use this formula:

    LookUp(colNames, Name = CBTeaMem.Selected.Result, EmploymentStatusType)

    This time check if you can get the correct value.

    Best regards,

    Allen

  • ShaneITAutomate Profile Picture
    301 on at

    Thankyou, can you not use a dropdown? Alls good in this situation i can use a label as its a hidden feature but i have another one which is a dropdown?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard