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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / ClearCollect multiple ...
Power Apps
Unanswered

ClearCollect multiple people columns

(0) ShareShare
ReportReport
Posted on by 134

I have an approval app that i want to be able to run a clearcollect to filter a gallery.

There are 4 approval levels in this, and i would like to do something like this:

i only want them to see items they are mentioned in. is there a way for a clearcollect to look through ALL the columns listed below and only grab the things that the current User().Email is associated with?

 

I was able to build one where it grabbed by creator already, but now i need to seek from many columns and im LOST.

 

I have a gallery like this already, but i think it would need to be a collection. im trying to avoid direct permissions or passwords

If(
    varStatus = 1,
    ApprovalCollection,
    varStatus = 2,
    Filter(
        ApprovalCollection,
        User().Email in 'First Approver'.Email ||
        User().Email in 'Second Approver'.Email ||
        User().Email in 'Specialty Approver'.Email ||
        User().Email in 'Final Approver'.Email
    ),
    varStatus = 3,
    ColApproved,
    varStatus = 4,
    colDeclined
)

 

this one will work for the 4 level:

ClearCollect(
    ApprovalCollection,
    Filter(
        'Purchase Approvals',
        "Pending" in Status.Value
    )
 
Thank you in advance!
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    Hi @BHaapi 

    You have three potential data sources there ApprovalCollection, colApproved, and colDeclined. You cannot use more than one for the potential outcomes of a filter. What are the "rules" for the four outcomes of varStatus, what is the common data source you can filter them all from and what are the "rules" for filtering on each.

  • BHaapi Profile Picture
    134 on at

    @WarrenBelz 

     

    they are all coming from one SP source: 'Purchase Approvals'. we know that the list will get bigger than 500 so to avoid the stress on the system i split it into several smaller collections based on a Status.Value column: Status approved is colApproved, status decline is colDeclined and everything else is within the variety of "pending" (pending first approval, second approval, special approval, final approval) and that is the one i want to actually split to only grab things that they are mentioned in the aforementioned people columns. right now it grabs all pending but i want it to only grab status pending  AND that the User().Email is mentioned in one or more of these columns:

     

    User().Email in 'First Approver'.Email ||
            User().Email in 'Second Approver'.Email ||
            User().Email in 'Specialty Approver'.Email ||
            User().Email in 'Final Approver'.Email
  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    @BHaapi ,

    OK - disregard Delegation for the moment - we can probably create a Delegable filter. If you were constructing directly on the List 'Purchase Approvals', what filters do you need to the varStatus options (1,2,3,4)

  • BHaapi Profile Picture
    134 on at

    Hi @WarrenBelz,

    I need a filter for

    1. All submissions (varStatus 1),
    2. My Pending submissions (this is a variety of "pending first approval/second approval/specialty approval/final approval" which I currently use the "Pending" in Status.Value equation) (2),
    3. Approved submissions (3)
    4. Declined submissions (4)
  • Verified answer
    BHaapi Profile Picture
    134 on at

    I was able to get the clear collect to work! i used the below and it seems to be working. 

     

    ClearCollect(
        ApprovalCollection,
        Filter(
            PA2,
            User().Email in 'Authorization L1'.Email && "Pending" in Status.Value || User().Email in 'Authorization L2'.Email && "Pending" in Status.Value || User().Email in 'Specialty Authorization'.Email && "Pending" in Status.Value || User().Email in 'Final Authorization'.Email && "Pending" in Status.Value
        )
    );
     
    Now, however, im having issues with the varStatus 2 showing just things they are currently assigned to do. they could be mentioned in any of the 4 above levels, and im trying to filter this new clearcollect to only show if they are mentioned and they HAVE NOT submitted a response to that level. 
     
    i have the filter as such:
    SortByColumns(
        If(
            varStatus = 1,
            ApprovalCollection,
            varStatus = 2,
            Filter(
                ApprovalCollection,
                User().Email in 'Authorization L1'.Email && IsBlank('L1 Details') Or User().Email in 'Authorization L2'.Email && IsBlank('L2 Details') Or User().Email in 'Specialty Authorization'.Email && IsBlank('Spec Details') Or User().Email in 'Final Authorization'.Email && IsBlank('Final Details')
            ),
            varStatus = 3,
            ColApproved,
            varStatus = 4,
            colDeclined
        ),
        "Urgent",
        SortOrder.Descending
     
    but its only showing items that qualify for the first statement (i highlighted the statement). I made sure there are items in the list that would work for the other statements, but they arent filtering in. I tried both Or and || and neither seem to work.
  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    @BHaapi ,

    You still need to filter everything from a single data source - I will also take a guess here that none of your data source fields are multi-select, so you do not need the in filter - does this suit your needs ?

    SortByColumns(
     Filter(
     'Purchase Approvals',
     (
     varStatus = 1 ||
     (varStatus = 2 && Status.Value = "Pending") ||
     (varStatus = 3 && Status.Value = "Approved") ||
     (varStatus = 4 && Status.Value = "Declined")
     ) && 
     ('Authorization L1'.Email = User().Email && IsBlank('L1 Details')) ||
     ('Authorization L2'.Email = User().Email && IsBlank('L2 Details')) ||
     ('Specialty Authorization'.Email = User().Email && IsBlank('Spec Details')) ||
     ('Final Authorization'.Email = User().Email && IsBlank('Final Details'))
     ),
     "Urgent",
     SortOrder.Descending
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • BHaapi Profile Picture
    134 on at

    @WarrenBelz 

    Status.Value is a multiple choice column. I did try this and it didnt seem to work. i also swapped around the top half for the "Pending" in Status.Value and that didnt work either unfortunately.

    i get this, saying that it doesnt seem to find the people columns anymore

     

    BHaapi_0-1710855096644.png

     

  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    @BHaapi ,

    How can Status be multiple choice when you have different options for each ? However you need to address the person column issue, which is not making a lot of sense if they are in your data source.

  • BHaapi Profile Picture
    134 on at

    There are 3 with the choice of pending.

    BHaapi_0-1710936223024.png

    I'm not sure why it didn't pick up those people columns when i put it in, it picked them up in the other equation. I think i resolved the filters within the app for now though, thank you so much for your assistance @WarrenBelz !

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard