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 Apps
Answered

Multiple filters

(0) ShareShare
ReportReport
Posted on by 163

Hi,

 

I am struggling to get this formula to work correctly and was hoping someone can help.

 

I have a gallery that originally had 2 filters that users would use and that worked fine, but they have since asked for a 3rd filter option and I cannot seem to get all 3 filters to work along side each other. 

 

This is my formula which doesn't error, it just doesn't seem to work:

If(IsBlank(txt_progressRC_search.Text),
With(
{
SelectedStatus: If(
'dd_progress-RC_status'.Selected.Value = "Pending", "Awaiting",
'dd_progress-RC_status'.Selected.Value = "Approved", "Approved",
'dd_progress-RC_status'.Selected.Value = "Rejected", "Rejected",
'dd_progress-RC_status'.Selected.Value = "Cancelled", "Cancelled"
)
},
SortByColumns(
colAllItems,
"ID",
SortOrder.Descending
)
),

If(!IsBlank(cmb_progressRC_RCcontact.Selected.Result),
Filter(colAllItems,
varRCFilter in ResourcingContact.DisplayName || varRCFilter in ResourcingDelegate.DisplayName),

Filter(
colAllItems,
txt_progressRC_search.Text in ID)))

 

 

The outcome needs to be that they all work in conjunction with each other, and none over write each other.

Categories:
  • Rajkumar_M Profile Picture
    3,747 Moderator on at

    Hi

    Try this formula

    If(

    IsBlank(txt_progressRC_search.Text),

    With( {

    SelectedStatus: If( 'dd_progress-RC_status'.Selected.Value = "Pending", "Awaiting",

    'dd_progress-RC_status'.Selected.Value = "Approved", "Approved",

    'dd_progress-RC_status'.Selected.Value = "Rejected", "Rejected",

    'dd_progress-RC_status'.Selected.Value = "Cancelled", "Cancelled" ) },

    SortByColumns( colAllItems, "ID", SortOrder.Descending ) ),

    Filter( colAllItems, varRCFilter in ResourcingContact.DisplayName ||

    varRCFilter in ResourcingDelegate.DisplayName, txt_progressRC_search.Text in ID, cmb_progressRC_RCcontact.Selected.Result in ResourcingContact.DisplayName, 'dd_progress-RC_status'.Selected.Value in {"Pending", "Approved", "Rejected", "Cancelled"} ) )

    (Or)

    SortByColumns(
    Filter(
    colAllItems,
    If(
    IsBlank(txt_progressRC_search.Text),
    true,
    txt_progressRC_search.Text in ID
    ) &&
    If(
    !IsBlank(cmb_progressRC_RCcontact.Selected.Result),
    varRCFilter in ResourcingContact.DisplayName || varRCFilter in ResourcingDelegate.DisplayName
    ) &&
    Switch(
    dd_progress-RC_status.Selected.Value,
    "Pending", SelectedStatus = "Awaiting",
    "Approved", SelectedStatus = "Approved",
    "Rejected", SelectedStatus = "Rejected",
    "Cancelled", SelectedStatus = "Cancelled",
    true, true
    )
    ),
    "ID",
    SortOrder.Descending
    )

    Thanks!

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.

  • lalford09 Profile Picture
    163 on at

    Thanks, both formulas give a couple errors, this is the second formula

    lalford09_0-1690805207446.png

    The error is SelectedStatus isn't recognised

  • Rajkumar_M Profile Picture
    3,747 Moderator on at

    Use Switch function 

    Switch( dd_progress-RC_status.Selected.Value,
    "Pending", "Awaiting", "Approved",
    "Approved", "Rejected",
    "Rejected", "Cancelled",
    "Cancelled", true, false)


    SortByColumns(
    Filter(
    colAllItems,
    If(
    IsBlank(txt_progressRC_search.Text),
    true,
    txt_progressRC_search.Text in ID
    ) &&
    If(
    !IsBlank(cmb_progressRC_RCcontact.Selected.Result),
    varRCFilter in ResourcingContact.DisplayName || varRCFilter in ResourcingDelegate.DisplayName
    ) &&
    Switch(
    dd_progress-RC_status.Selected.Value,
    "Pending", "Awaiting",
    "Approved", "Approved",
    "Rejected", "Rejected",
    "Cancelled", "Cancelled",
    true, false
    )
    ),
    "ID",
    SortOrder.Descending
    )

  • lalford09 Profile Picture
    163 on at

    I've updated it but seem to be getting a different error:

     

    lalford09_0-1690806114539.png

     

  • Rajkumar_M Profile Picture
    3,747 Moderator on at

    Remove Boolean datatype true,true.

  • lalford09 Profile Picture
    163 on at

    That removed the error but the gallery is blank all the time now, so I have tried the first formula you sent but get this error:

    lalford09_0-1690807369567.png

     Here:

    lalford09_1-1690807397390.png

     

  • lalford09 Profile Picture
    163 on at

    I have tried this formula but the gallery is still showing as empty:

     

    SortByColumns(
    Filter(
    colAllItems,
    If(
    IsBlank(txt_progressRC_search.Text),
    txt_progressRC_search.Text in ID
    ) && If(
    !IsBlank(cmb_progressRC_RCcontact.Selected.Result),
    varRCFilter in ResourcingContact.DisplayName || varRCFilter in ResourcingDelegate.DisplayName
    ) && Switch(
    dd_progress_RC_status.Selected.Value,
    "Pending",
    "Awaiting",
    "Approved",
    "Approved",
    "Rejected",
    "Rejected",
    "Cancelled",
    "Cancelled"
    )
    ),
    "ID",
    SortOrder.Descending
    )

  • lalford09 Profile Picture
    163 on at

    @Rajkumar_404 any ideas?

  • Rajkumar_M Profile Picture
    3,747 Moderator on at

    Try this

    Filter(
    colAllItems,
    If(
    IsBlank(txt_progressRC_search.Text),
    true,
    txt_progressRC_search.Text in ID
    ),
    If(
    IsBlank(cmb_progressRC_RCcontact.Selected.Result),
    true,
    varRCFilter in ResourcingContact.DisplayName || varRCFilter in ResourcingDelegate.DisplayName
    ),
    varSelectedStatus in If(
    dd_progress-RC_status.Selected.Value = "Pending", "Awaiting",
    dd_progress-RC_status.Selected.Value = "Approved", "Approved",
    dd_progress-RC_status.Selected.Value = "Rejected", "Rejected",
    dd_progress-RC_status.Selected.Value = "Cancelled", "Cancelled"
    )
    )

  • lalford09 Profile Picture
    163 on at

    So I had to tweak it slightly to this but it still isn't working correctly as the status drop down is now only showing approved on all the statuses:

    Filter(
    colAllItems,
    If(
    IsBlank(txt_progressRC_search.Text),
    true,
    txt_progressRC_search.Text in ID
    ),
    If(
    IsBlank(cmb_progressRC_RCcontact.Selected.Value),
    true,
    cmb_progressRC_RCcontact.Selected.Value in ResourcingContact.DisplayName || cmb_progressRC_RCcontact.Selected.Value in ResourcingDelegate.DisplayName
    ),
    dd_progress_RC_status.Selected.Value in If(
    dd_progress_RC_status.Selected.Value = "Pending", "Awaiting",
    dd_progress_RC_status.Selected.Value = "Approved", "Approved",
    dd_progress_RC_status.Selected.Value = "Rejected", "Rejected",
    dd_progress_RC_status.Selected.Value = "Cancelled", "Cancelled"
    )
    )

     

    @Ethan_R I believe you helped resolve the original query I had with this filter a while back, have you got any ideas how we can get this one working?

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 396 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 323

#3
WarrenBelz Profile Picture

WarrenBelz 193 Most Valuable Professional

Last 30 days Overall leaderboard