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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter gallery based o...
Power Apps
Unanswered

Filter gallery based on multiple conditions

(0) ShareShare
ReportReport
Posted on 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

 

Categories:
I have the same question (0)
  • Kiruthika22 Profile Picture
    61 on at

    Hi anyone,

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

    Any help would be appreciated.

     

    Thanks,

    Kiruthika

  • WarrenBelz Profile Picture
    155,779 Most Valuable Professional on at

    @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 at

    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.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 494

#2
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#3
11manish Profile Picture

11manish 323

Last 30 days Overall leaderboard