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
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.
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
Hi anyone,
Please help me..I am really struck at this point.
Any help would be appreciated.
Thanks,
Kiruthika
WarrenBelz
637
Most Valuable Professional
stampcoin
570
Super User 2025 Season 2
Power Apps 1919
473