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 III
Super User III

@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

View solution in original post

5 REPLIES 5
RandyHayes
Super User III
Super User III

@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

I'm using it on my Items for the gallery which harbors the checkbox.

RandyHayes
Super User III
Super User III

@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

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 III
Super User III

@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

View solution in original post

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

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

Top Solution Authors
Top Kudoed Authors
Users online (1,999)