cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dk4
Helper I
Helper I

Splitting person/group column to get distinct values on gallery

Hey,

 

I'm trying to create a filter based on distinct values shown on a sp person group list.

 

My column has the following data,

John;John Doe; ane;Jane Doe

 

What I'm trying to achieve

John

John Doe

Jane

Jane Doe

 

The formula I've tried is:

 

 

Filter(
    Distinct(
        Split(
            Concat(
            Mysource, People.DisplayName, "; "
            ),
            "; "
        ),
        Result
    ),
    !IsBlank(Result)
)

 

 

 

I however keep getting an error it expects texts, how do I swiftly tweak the formula to achieve my desired goal?

 

TIA 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Dk4 

Yeah sure, just change the formula to the following:

Distinct(
    Filter(
        Split(
            Concat(
               Mysource, 
               Concat(People, DisplayName & ";") & ";"
            ),
            ";"
        ),
        !IsBlank(Result)
    ),
    Result
)
_____________________________________________________________________________________
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

5 REPLIES 5
RandyHayes
Super User
Super User

@Dk4 

Where are you trying to use this formula? 

_____________________________________________________________________________________
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'm using it on my Items for the gallery which harbors the checkbox.

RandyHayes
Super User
Super User

@Dk4 

I ask because your formula is good.  Where is it complaining about expecting a Text?

The only thing I would change is your order of filter and distinct:

Distinct(
    Filter(
        Split(
            Concat(
               Mysource, People.DisplayName, ";"
            ),
            ";"
        ),
        !IsBlank(Result)
    ),
    Result
)

 

NOW, the bigger question is going to be, does your People column allow for multiple choices?  If so, then the above will not work.

_____________________________________________________________________________________
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!

It's complaining of the Concat function. Yes from sp my column allows multiple selection, I need it since at a go I'll be selecting multiple guys.

Is there an alternative, I need to use the people in the columns in a filter?

 

 

RandyHayes
Super User
Super User

@Dk4 

Yeah sure, just change the formula to the following:

Distinct(
    Filter(
        Split(
            Concat(
               Mysource, 
               Concat(People, DisplayName & ";") & ";"
            ),
            ";"
        ),
        !IsBlank(Result)
    ),
    Result
)
_____________________________________________________________________________________
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

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!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,517)