cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
colbyc
Helper III
Helper III

Distinct dropdown

I have a Sharepoint column (B) in a list (List2) referencing another column (A) in another list (List1). In List2 column B, I need it to show every distinct value of column A via dropdown menu for users to select from. So far using the distinct function I have just gotten errors.

1 ACCEPTED SOLUTION

Accepted Solutions

@colbyc 
I believe I was just missing the .Result in my previous code.  This will work if Column A is a single-line text type (not a Choices type).

Distinct('List 1', 'Column A').Result

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

12 REPLIES 12
mdevaney
Super User III
Super User III

@colbyc

How are you referencing ListB from ListA?  Is it a single-line text column?  Or is it a lookup?  (I am hoping for text).  I know how to do this and can help you out.

 

If you provide some sample data I'm happy to use your column names in the solution.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

KranthiTupakula
Responsive Resident
Responsive Resident

Please watch this video!! This is an excellent video that talks about distinct function.

https://www.youtube.com/watch?v=Ap3_Ea9H8b0&ab_channel=ShaneYoung

 

______________________________

If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

@mdevaney 

 

It is via a lookup column. Would this be easier to reference via a singleline text field?

 

Sample Data:

If List 1 Column A looks like:

Column A

AA

BB
BB
CC
CC
CC

List 2, Column B's drop down options should be:

Column B
AA
BB
CC

@colbyc 
Yes, if you use a single-line text column you can take the 'lazy' way of doing it and put this DISTINCT code in the Items property of the dropdown.

 

Distinct('List 1', 'Column A')

 

 

The output will show in the dropdown menu like this:

 

Result
AA
BB
CC

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

@mdevaney 

 

Does a single line of text have an Items property? I am not seeing one. Also though (and this mistake might have altered your response), I reversed Column/List names between my intial post and my first response to you. I've edited above posts to make them all match.

 

 

@colbyc 

Actually, its the dropdown in PowerApps that has the Items property 🙂

I'm not seeing a dropdown though for that field in PowerApps. Its just a text box. In the properties menu (after clicking on the textbox of field) Items is not an option.

@mdevaney sorry forgot to tag in other response

@colbyc 
It might be helpful to share a screenshot of your app.  I'm not certain what we are dealing with here.  I thought it was a dropdown 🙂

 

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (81,214)