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 / Help with a filter/sor...
Power Apps
Answered

Help with a filter/sort on a Gallery

(0) ShareShare
ReportReport
Posted on by 106

Hi

I need help with a filter/sort on a Gallery (Gal_AllCandidatesView).


I have a DropDown Dd_ChooseResponsible, where I need to Filter on the value Liable (it's a text column in Salary_MasterData and contains names), so if I chosse the name Peter in Dd_ChooseResponsible, then Gal_AllCandidatesView should only show Peter's candidates.
But I then also have a ComboBox CBox_SearchCandidate, where I can filter on the candidates Name or Mail (also from Salary_MasterData): I need to have Dd_ChooseResponsible working independent of CBox_SearchCandidate and vice versa.
So when I find Peter in Dd_ChooseResponsible, it shows Peter's candidates, when I then reset the filters and will filter for all users with the names starting with B in CBox_SearchCandidate it should find all users with B in name or mail.

 

varSortValue and varSortDirection are from OnStart.
Set(varSortValue, "VIP"),
Set(varSortDirection, "Descending")


SortByColumns(
Filter(
Salary_MasterData,
Concluded = false,

(IsBlank(Dd_ChooseResponsible.Selected.Result) || Liable = Dd_ChooseResponsible.Selected.Result)
||
(IsBlank(CBox_SearchCandidate.SelectedItems) || CandidateName = CBox_SearchCandidate.Selected.CandidateName || CandidateMail = CBox_SearchCandidate.Selected.CandidateMail)


),

varSortValue, //variabel sat i OnStart
varSortDirection, //variabel sat i OnStart

"VIP", SortOrder.Descending,
"CandidateStartDate", SortOrder.Ascending,
"CandidateName", SortOrder.Ascending,
"Styrelse", SortOrder.Ascending,
"Liable", SortOrder.Ascending,
"CandidateMail", SortOrder.Ascending
)

Categories:
I have the same question (0)
  • JohnM86 Profile Picture
    590 on at

    Try:

     

    SortByColumns(
    Filter(
    Salary_MasterData,
    Concluded = false &&
    (IsBlank(Dd_ChooseResponsible.Selected.Result) || Liable = Dd_ChooseResponsible.Selected.Result) &&
    (IsBlank(CBox_SearchCandidate.SearchText) ||
    StartsWith(CandidateName, CBox_SearchCandidate.SearchText, StringComparison.CurrentCultureIgnoreCase) ||
    StartsWith(CandidateMail, CBox_SearchCandidate.SearchText, StringComparison.CurrentCultureIgnoreCase)
    )
    ),
    varSortValue, //variable set in OnStart
    varSortDirection, //variable set in OnStart
    "VIP", SortOrder.Descending,
    "CandidateStartDate", SortOrder.Ascending,
    "CandidateName", SortOrder.Ascending,
    "Styrelse", SortOrder.Ascending,
    "Liable", SortOrder.Ascending,
    "CandidateMail", SortOrder.Ascending
    )

  • Verified answer
    Rene_Newbee Profile Picture
    106 on at

    I found this solution, it seems to work.

     

    SortByColumns(
    Filter(
    Salary_MasterData,
    Concluded = false, //Fjerne først alle hvor candidaten er sat til Concluded

    IsBlank(Dd_ChooseResponsible.Selected.Result) || Liable = Dd_ChooseResponsible.Selected.Result, //Er Dd_ChooseResponsible blank eller er der valgt en Liable person
    IsBlank(CBox_SearchCandidate.SelectedItems) && true //CBox_SearchCandidate er blank eller om der er søgt på candidate navn eller mail
    ||

    (!IsBlank(CBox_SearchCandidate.SelectedItems) && //CBox_SearchCandidate ikke er blank

    Or(
    StartsWith(CandidateName, CBox_SearchCandidate.Selected.CandidateName), //er der søgt på candidate navn
    StartsWith(CandidateMail, CBox_SearchCandidate.Selected.CandidateMail) //er der søgt på candidate mail
    )
    )
    ),
    varSortValue,
    varSortDirection,
    "VIP", SortOrder.Descending,
    "CandidateStartDate", SortOrder.Ascending,
    "CandidateName", SortOrder.Ascending,
    "Styrelse", SortOrder.Ascending,
    "Liable", SortOrder.Ascending,
    "CandidateMail", SortOrder.Ascending
    )

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard