cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PeterDonohue
Advocate II
Advocate II

Distinct Collection Still Showing Duplicates

Hey folks,

I have a collection that ius generated from a sharepoint list using a DISTINCT function. I'm calling this collection to populate a dropdown list but here's the kicker - I'm still getting duplicates? I checked the source and ensured there were no spaces etc

 

On Start

 

ClearCollect(
    colAreas,
    Distinct(
        'Strategies, Plans, and Policies',
        'Responsible Area '
    )
)

 

Dropdown

 

Sort(
    colAreas,
    Result,
    Ascending
)

 

 

This has got me stumped

6 REPLIES 6
timl
Super User III
Super User III

Hi @PeterDonohue 

This sounds very strange. I guess there must be some small or subtle differences in the non-distinct values that you're seeing.

When you say that you checked the spaces in the source, did you check for additional spaces between words, in addition to leading and trailing spaces?

To diagnose this further, what do you see when you call the distinct function on colAreas? For example, with this formula, do you still see non-distinct results in colAreas2?

ClearCollect(
            colAreas2,
            Distinct(
                     colAreas,
                     Result
           )
)

 

Hey @timl I had excactly the same thought process 🙂

 

I actually click and dragged the source data to ensure it was identical so there should be no issue there. 

 

I also tried calling a DISTINCT function from colAreas and i still see duplicates. 

Got me baffled

@ham I checked those sites but they are not what I'm looking for. The Sharepains site is pretty woeful user expereince and extremely hard to understand

Hi @PeterDonohue 

In my experience, this is usually due to a following space. Trim() the column before using the Distinct() function.

Hi @PeterDonohue 

Great minds think alike!

To diagnose this further, maybe you could also return the length of the items in colAreas? Is there a discrepancy in length between the items that look the same?

ClearCollect(
            colAreas2,
            AddColumns(
                       Distinct(
                                colAreas,
                                Result
                        ),
                        "ResultLen",
                        Len(Result)
             )

)

 

 

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 (68,679)