Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Filter tickets in gallery on basis of search box text value

Posted on by

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.

 

 

  • AJ_vizMan Profile Picture
    AJ_vizMan on at
    Re: Filter tickets in gallery on basis of search box text value

    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
    )

     

  • WarrenBelz Profile Picture
    WarrenBelz 143,591 on at
    Re: Filter tickets in gallery on basis of search box text value

    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.

  • AJ_vizMan Profile Picture
    AJ_vizMan on at
    Re: Filter tickets in gallery on basis of search box text value

    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.

     

  • WarrenBelz Profile Picture
    WarrenBelz 143,591 on at
    Re: Filter tickets in gallery on basis of search box text value

    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.

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,591

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,090

Leaderboard