cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AJ_vizMan
Helper I
Helper I

Filter tickets in gallery on basis of search box text value

Hi, have designed a powerapps in which filtration of tickets is on the basis of ticket "sub category". And there are 2 admin teams who work on the tickets and can see the tickets belong to their Sub category.

 

Now, have to filter the tickets on the basis of ticket id using search box. But, i have no thoughts how to achieve it.

 

Formula used to filter items in Gallery :
If(isAdmin,
If(MyProfile.Mail in COE_CW_Admin,
Sort(Filter(AllTickets, SubCategory in MDTeam_SubCategory),Created,Descending),
MyProfile.Mail in COE_SF_Admin,
Sort(Filter(AllTickets, SubCategory in CoETeam_SubCategory),Created,Descending)
),
Sort(Filter(AllTickets,'Created By'.Email = MyProfile.Mail || 'Created By'.Claims = MyProfile.UserPrincipalName),Created,Descending)
)

 

As filtration is based on ticket Sub category changing here may loose filtration.

Could you please suggest to achieve searching tickets using ticket id.

 

 

4 REPLIES 4
WarrenBelz
Super User
Super User

HI @AJ_vizMan ,

I am assuming a field name of 'Ticket ID' here

Sort(
   Filter(
      AllTickets,
      (
         IsBlank(YourSearchBox.Text) ||
         YourSearchBox.Text in 'Ticket ID'
      ) &&
      If(
         isAdmin,
         Subcategory in
         If(
            MyProfile.Mail in COE_CW_Admin,
            MDTeam_SubCategory,
            CoETeam_SubCategory
         ),
         'Created By'.Email = MyProfile.Mail || 
         'Created By'.Claims = MyProfile.UserPrincipalName
      ),		 
      Created,
      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.

Hi @WarrenBelz , thank you for quick response.

I used your response with minor updates however, i am not getting filtered tickets in gallery.

And there is no error in the formula.

Clarifications

1. Ticket ID is a numeric field with name 'ID' as in SP list.

Formula :-->

Sort(Filter(AllTickets,
(IsBlank(TicketSearchbox.Text) || TicketSearchbox.Text in ID) &&
If(isAdmin, SubCategory in
If(MyProfile.Mail in COE_CW_Admin, MDM_SubCategory,
If(MyProfile.Mail in COE_SF_Admin, COE_SF_SubCategory)),
//If(MyProfile.Mail in COE_SF_Admin, COE_SF_SubCategory) expand code for new team
'Created By'.Email = MyProfile.Mail || 'Created By'.Claims = MyProfile.UserPrincipalName
),
Created),
Descending
)

 

Do you see any tweak in the formula or anything else to check. Appreciate your response.

 

Hi @AJ_vizMan ,

As you have mentioned, the syntax is correct providing your data references have the potential to produce the result you are after. I cannot see your data, but with the complexity you are attempting, you need to "break this apart into bits that work and then add things until it stops working - you will then hopefully see what the problem is.

 

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.

Hi @WarrenBelz - have worked on the code and achieved the required functionality 😊

Thank you for support. 🎩 off

 

Final code look like below where item can be searched on basis of multiple columns :

Sort(
Filter(
AllTickets,
(
IsBlank(TicketSearchbox.Text) ||
TicketSearchbox.Text in ID || TicketSearchbox.Text in SubCategory || TicketSearchbox.Text in TicketAssignedToIndividual || TicketSearchbox.Text in TaskStatus.Value
) &&
If(
isAdmin,
SubCategory in
If(
MyProfile.Mail in COE_CW_Admin,
MDM_SubCategory, 
COE_SF_SubCategory
),
('Created By'.Email = MyProfile.Mail ||
'Created By'.Claims = MyProfile.UserPrincipalName
)
)),
Created,
Descending
)

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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 (785)