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

Community site session details

Session Id : mdBsAXeO948RMBILq2oZ51
Power Apps - Building Power Apps
Unanswered

Filter gallery based on multiple conditions

Like (0) ShareShare
ReportReport
Posted on 28 Oct 2022 04:18:16 by 61

Hi Team,

I have a requirement to filter a gallery based on three different columns in sharepoint. I have used a if condition in the gallery items property to filter based on the button selected. 

The three columns are person type columns ==admin,supervisor,submittedBy

Sharepoint list name----TestSp

I need to display the records in the else condition whereever the 

- current loggedin user is present in the admin column (and)

- current loggedin user is supervisor but not equal to submittedBy (and)

- current loggedin user not equal to submittedBy

 

I have used the below code: It is not throwing syntax error but not displaying any record. 

Totally i have 2 items tagged as admin and 2 items as supervisor(SubmittedBy != Supervisor)

So i should see 4 records in the gallery.

=====================

If(
varSet = true,
Sort(
Filter(
'TestSp',
StartsWith(
'Opportunity name',
'txt.Search'.Text
),
Status.Value = "Approved" && (Lower('SubmittedBy'.Email) = Lower(User().Email)) && (Assessment_status.Value = 'Drp.Status_1'.Selected.Value || 'Drp.Status_1'.Selected.Value = Blank()),
(DateValue(Created) >= DateValue(Date_1))
),
Modified,
Descending
),
Sort(
Filter(
'TestSp',
StartsWith(
'Opportunity name',
'txt.Search'.Text
),
(Lower(User().Email) = Lower('admin'.Email)),
((Lower(User().Email) = Lower('Supervisor'.Email)) && (Lower(User().Email) <> Lower('SubmittedBy'.Email))) && (Assessment_status.Value = "Draft" || Assessment_status.Value = "Approval Pending" || Assessment_status.Value = "Approved" || Assessment_status.Value = "Rejected") && (Assessment_status.Value = 'Drp.Status_1'.Selected.Value || 'Drp.Status_1'.Selected.Value = Blank()),
(DateValue(Created) >= DateValue(Date_1))
),
Modified,
Descending
)
)

 

Please help me out .

Thanks and Regards,

Kiruthika

 

  • Kiruthika22 Profile Picture
    61 on 04 Jan 2023 at 10:40:14
    Re: Filter gallery based on multiple conditions

    Hi @WarrenBelz ,

    Sorry for delayed reply. This was really helpful with some tweaks in the logic added and my issue got resolved.

    Thanks for your help.

  • WarrenBelz Profile Picture
    149,158 Most Valuable Professional on 07 Nov 2022 at 07:00:36
    Re: Filter gallery based on multiple conditions

    @Kiruthika22 ,

    I will give you a start here, but it is very hard to interpret your needs with a model to test on (which I cannot do)

    Sort(
     Filter(
     'TestSp',
     StartsWith(
     'Opportunity name',
     'txt.Search'.Text
     ) &&
     Status.Value = "Approved" && 
     Created >= Date_1 &&
     (
     varSet && Lower('SubmittedBy'.Email) = Lower(User().Email) ||
     (
     !varSet &&
     Lower(User().Email) = Lower('Supervisor'.Email) && 
     Lower(User().Email) <> Lower('SubmittedBy'.Email) 
     )
     ) && 
     (
     Assessment_status.Value = "Draft" || 
     Assessment_status.Value = "Approval Pending" || 
     Assessment_status.Value = "Approved" || 
     Assessment_status.Value = "Rejected" ||
     Assessment_status.Value = 'Drp.Status_1'.Selected.Value || 
     'Drp.Status_1'.Selected.Value = Blank()
     )
     ),
     Modified,
     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.

    Visit my blog Practical Power Apps

     

  • Kiruthika22 Profile Picture
    61 on 29 Oct 2022 at 03:25:26
    Re: Filter gallery based on multiple conditions

    Hi anyone,

    Please help me..I am really struck at this point.

    Any help would be appreciated.

     

    Thanks,

    Kiruthika

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473