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 status value by...
Power Apps
Answered

filter status value by selecting buttons

(0) ShareShare
ReportReport
Posted on by 525

Hello Community, 

 

Is there any way can make filter status by selecting buttons? 

I am using this formula and work for me for different buttons. now i want one more button can filter all open ticket expects closed. so, i created button name is open tickets' want when i click on open ticket should filter all tickets. Expects closed tickets. 

here is my formula for filter search and dropdowns. 

Sort(
With(
{
_IsAdmin: !IsBlank(
LookUp(
'User ID Hanhelp',
'Admin '.DisplayName = User().FullName
)
),
_UserProperty: LookUp(
'HH Power App',
'Created By'.DisplayName = User().FullName && Property.Value = Dropdown5.Selected.Value
).Property.Value
},
Filter(
'HH Power App',
('Created By'.DisplayName = User().FullName || _IsAdmin || Property.Value = _UserProperty),
(IsBlank(TextInput6.Text) || ID = If(
IsBlank(TextInput6.Text),
-1,
Value(TextInput6.Text)
)),
(IsBlank(varStatusFilter) || Status.Value = varStatusFilter),
(IsBlank(Dropdown2.Selected.Value) || Dropdown2.Selected.Value = Category.Value),
(IsBlank(Dropdown3.Selected.Value) || Dropdown3.SelectedText.Value = Priority.Value),
(IsBlank(Dropdown5.Selected.Value) || Dropdown5.SelectedText.Value = Property.Value),
(IsBlank(Dropdown4.Selected.Value) || Dropdown4.Selected.Value = 'Assigned Analyst'.DisplayName)
)
),
ID,
SortOrder.Descending
)

 

mbhatt_0-1690793021050.png

here is all button Property. 

mbhatt_1-1690793050844.png

 

 

this formula is work better without any delegation. 

is there any way to add one more condition for open tickets? 

 

Categories:
  • the_dude Profile Picture
    361 Super User 2024 Season 1 on at

    Hi mbhatt,

     

    Not sure if I interpreted your issue and formula correctly, but could you give this a try?:

     

    Sort(
     With(
     {
     _IsAdmin: !IsBlank(LookUp('User ID Hanhelp', 'Admin '.DisplayName = User().FullName)),
     _UserProperty: LookUp('HH Power App', 'Created By'.DisplayName = User().FullName && Property.Value = Dropdown5.Selected.Value).Property.Value
     },
     Filter(
     'HH Power App',
     ('Created By'.DisplayName = User().FullName || _IsAdmin || Property.Value = _UserProperty),
     (IsBlank(TextInput6.Text) || ID = If(IsBlank(TextInput6.Text), -1, Value(TextInput6.Text))),
     (IsBlank(varStatusFilter) || (Status.Value = varStatusFilter && varStatusFilter <> "Closed")), // Exclude Closed tickets
     (IsBlank(Dropdown2.Selected.Value) || Dropdown2.Selected.Value = Category.Value),
     (IsBlank(Dropdown3.Selected.Value) || Dropdown3.SelectedText.Value = Priority.Value),
     (IsBlank(Dropdown5.Selected.Value) || Dropdown5.SelectedText.Value = Property.Value),
     (IsBlank(Dropdown4.Selected.Value) || Dropdown4.Selected.Value = 'Assigned Analyst'.DisplayName)
     )
     ),
     ID,
     SortOrder.Descending
    )
  • Verified answer
    WarrenBelz Profile Picture
    156,538 Most Valuable Professional on at

    @mbhatt .

    As per the PM you sent - OnSelect of the Open Ticket button

    UpdateContext(
     {
     varStatus:
     If(
     varStatus <> "Open",
     "Open",
     Closed"
     )
     }
    )

    On the Text of the Button

    If(
     !IsBlank(varStatus),
     varStatus,
     "Open"
    ) & Tickets

    and the filter

    With(
     {
     _IsAdmin: 
     !IsBlank(
     LookUp(
     'User ID Hanhelp',
     'Admin '.DisplayName = User().FullName
     )
     ),
     _UserProperty: 
     LookUp(
     'HH Power App',
     'Created By'.DisplayName = User().FullName && 
     Property.Value = Dropdown5.Selected.Value
     ).Property.Value
     },
     Sort(
     Filter(
     'HH Power App',
     (
     'Created By'.DisplayName = User().FullName || 
     _IsAdmin || 
     Property.Value = _UserProperty
     ),
     (
     Len(TextInput6.Text) = 0 || 
     ID = Value(TextInput6.Text)
     ),
     (
     IsBlank(varStatusFilter) || 
     Status.Value = varStatusFilter
     ),
     (
     Len(Dropdown2.Selected.Value) = 0 || 
     Dropdown2.Selected.Value = Category.Value
     ),
     (
     Len(Dropdown3.Selected.Value) = 0 || 
     Dropdown3.Selected.Value = Priority.Value
     ),
     (
     Len(Dropdown5.Selected.Value) = 0 || 
     Dropdown5.Selected.Value = Property.Value
     ),
     (
     Len(Dropdown4.Selected.Value) = 0 || 
     Dropdown4.Selected.Value = 'Assigned Analyst'.DisplayName
     )
     ),
     ID,
     SortOrder.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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • mbhatt Profile Picture
    525 on at

    Hello 

    @WarrenBelz 

     

    Thank you so much for providing solution . currently i fix with by my self and its working for me 

    i did little brain surgery by using variable 

    Sort(
    With(
    {
    _IsAdmin: !IsBlank(
    LookUp(
    'User ID Hanhelp',
    Admin.DisplayName = User().FullName
    )
    ),
    _UserProperty: LookUp(
    'HH Power App',
    'Created By'.DisplayName = User().FullName && Property.Value = 'Property Dropdown'.Selected.Value
    ).Property.Value
    },
    Filter(
    'HH Power App',
    ('Created By'.DisplayName = User().FullName || _IsAdmin || Property.Value = _UserProperty),
    (IsBlank('ID Search'.Text) || ID = If(
    IsBlank('ID Search'.Text),
    -1,
    Value('ID Search'.Text)
    )),
    (varStatus_New && Status.Value = "New") ||
    (varStatus_InProgress && Status.Value = "In Progress") ||
    (varStatus_Escalated && Status.Value = "Escalated") ||
    (varStatus_CallRequested && Status.Value = "Call Requested") ||
    (varStatus_SiteResponded && Status.Value = "Site responded") ||
    (varStatus_SentToSiteTeam && Status.Value = "Sent to Site Team") ||
    (varStatus_Closed && Status.Value = "Closed"),
    (IsBlank('Category Dropdown'.Selected.Value) || 'Category Dropdown'.Selected.Value = Category.Value),
    (IsBlank('Priority Drop Down'.Selected.Value) || 'Priority Drop Down'.SelectedText.Value = Priority.Value),
    (IsBlank('Property Dropdown'.Selected.Value) || 'Property Dropdown'.SelectedText.Value = Property.Value),
    (IsBlank(Dropdown4.Selected.Value) || Dropdown4.Selected.Value = 'Created By'.DisplayName),
    (IsBlank(Dropdown1.Selected.Value) || Dropdown1.Selected.Value = 'Assigned Analyst'.DisplayName),
    (IsBlank('Status Drop Down'.Selected.Value) || 'Status Drop Down'.Selected.Value = Status.Value) // Add this line
    )
    ),
    ID,
    SortOrder.Descending
    )

     

    Thank you so much warren sir.

     

     

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard