Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Gallery filter issues, some items not being filtered correctly.

(0) ShareShare
ReportReport
Posted on by 81

Hi PowerApps Community,

I'm using 2 sets of code to filter 2 galleries to sort a list of tasks depending on "in progress/not started" and "finished", this works fine for most items in my sharepoint list. The issue is sometimes a tasked wich is marked as Not started OR In progress ends up in the "jobioDone" gallery (the one for the items marked as "Finished") I suppose there is a slight oversight in my second filter code but I cannot find it.

Code/gallery 1:

Sort(
 Sort(
 Filter(
 Search(
 AddColumns(
 CollectionAllUnitsJobList;
 "IDcopy";
 Text('Id (ID)')
 );
 txtSearchBox.Text;
 "JOB_SHORT_DESCRIPTION";
 "IDcopy"
 );
 (((User().Email = "example1@biopower.be" || User().Email = "example2@biopower.be") && JOB_WHO.Value = "OPR" && Not(JOB_STATUS.Value = "Finished")) && Not(JOB_Assigned = "Not Assigned") || (User().Email = "example3@biopower.be" && JOB_WHO.Value = "MECH" && Not(JOB_STATUS.Value = "Finished")) || (User().Email = "example4@biopower.be" && JOB_WHO.Value = "HSE" && Not(JOB_STATUS.Value = "Finished")) || ((User().Email <> "example5@biopower.be" || User().Email <> "example6@biopower.be" || User().Email = "example7@biopower.be") && Not(JOB_STATUS.Value = "Finished")) && Not(JOB_Assigned = "Assigned")) 
&& (IsBlank(cboFilterLocationStart.SelectedItems.Value) || IsEmpty(cboFilterLocationStart.SelectedItems.Value) || JOB_LOCATION.Value = cboFilterLocationStart.Selected.Value) && (IsBlank(cboFilterWhoStart.SelectedItems.Value) || IsEmpty(cboFilterWhoStart.SelectedItems.Value) || JOB_WHO.Value = cboFilterWhoStart.Selected.Value) && (IsBlank(cboFilterPrioStart.SelectedItems.Value) || IsEmpty(cboFilterPrioStart.SelectedItems.Value) || JOB_PRIORITY.Value = cboFilterPrioStart.Selected.Value) && (IsBlank(cboFilterPartsStart.SelectedItems.Value) || IsEmpty(cboFilterPartsStart.SelectedItems.Value) || JOB_PARTS_PRESENT.Value = cboFilterPartsStart.Selected.Value)
 );
 "Rijnummer";
 SortOrder.Ascending
 );
 JOB_PRIORITY.Value;
 SortOrder.Ascending
)

Code/gallery 2:

Sort(
 Sort(
 Filter(
 Search(
 AddColumns(
 CollectionAllUnitsJobList;
 "IDcopy";
 Text('Id (ID)')
 );
 txtSearchBoxDone.Text;
 "JOB_SHORT_DESCRIPTION";
 "IDcopy"
 );
(((User().Email = "example1@biopower.be" || User().Email = "example2@biopower.be" ) && JOB_WHO.Value = "OPR" &&(JOB_STATUS.Value = "Finished")) ||
 (User().Email = "example3@biopower.be" && JOB_WHO.Value = "MECH" && JOB_STATUS.Value = "Finished") ||
 (User().Email ="example4@biopower.be" && JOB_WHO.Value = "HSE" && JOB_STATUS.Value = "Finished") ||
 ((User().Email <> "example5@biopower.be" || User().Email <> "example6@biopower.be" || User().Email = "example7@biopower.be" ) && JOB_STATUS.Value = "Finished")) &&
 
 
 
 IsBlank(cboFilterLocationDone.SelectedItems.Value) || IsEmpty(cboFilterLocationDone.SelectedItems.Value) || JOB_LOCATION.Value = cboFilterLocationDone.Selected.Value;
 IsBlank(cboFilterWhoDone.SelectedItems.Value) || IsEmpty(cboFilterWhoDone.SelectedItems.Value) || JOB_WHO.Value = cboFilterWhoDone.Selected.Value;
 IsBlank(cboFilterPrioDone.SelectedItems.Value) || IsEmpty(cboFilterPrioDone.SelectedItems.Value) || JOB_PRIORITY.Value = cboFilterPrioDone.Selected.Value;
 IsBlank(cboFilterPartsDone.SelectedItems.Value) || IsEmpty(cboFilterPartsDone.SelectedItems.Value) || JOB_PARTS_PRESENT.Value = cboFilterPartsDone.Selected.Value
 );
 "Rijnummer";
 SortOrder.Ascending
 );
 JOB_PRIORITY.Value;
 SortOrder.Ascending
)

 

Any idea's?

Kind regards,

 

Sébastien

 

  • Verified answer
    PonceletSeba Profile Picture
    81 on at
    Re: Gallery filter issues, some items not being filtered correctly.

    Hi,

     

    Thanks for your reply,


    I found the error, whilst creating a task (filling out a form and submitting it), I connected the input of a wrong combo box resulting a false value being written to the tasks.

     

  • v-jefferni Profile Picture
    on at
    Re: Gallery filter issues, some items not being filtered correctly.

    Hi @PonceletSeba ,

     

    Do you mean some items with Job Status = "Finished" turn up in Gallery2 than Gallery1? Are they in Gallery1 as well? I also cannot find the reason why items that are not finished turn up in this Gallery,but you may try below formula instead:

    Sort(
     Sort(
     Filter(
     Filter(
     Search(
     AddColumns(
     CollectionAllUnitsJobList;
     "IDcopy";
     Text('Id (ID)')
     );
     txtSearchBoxDone.Text;
     "JOB_SHORT_DESCRIPTION";
     "IDcopy"
     );
    (((User().Email = "example1@biopower.be" || User().Email = "example2@biopower.be" ) && JOB_WHO.Value = "OPR" ) ||
     (User().Email = "example3@biopower.be" && JOB_WHO.Value = "MECH" ) ||
     (User().Email ="example4@biopower.be" && JOB_WHO.Value = "HSE" ) ||
     (User().Email <> "example5@biopower.be" || User().Email <> "example6@biopower.be" || User().Email = "example7@biopower.be" )) &&
     IsBlank(cboFilterLocationDone.SelectedItems.Value) || IsEmpty(cboFilterLocationDone.SelectedItems.Value) || JOB_LOCATION.Value = cboFilterLocationDone.Selected.Value;
     IsBlank(cboFilterWhoDone.SelectedItems.Value) || IsEmpty(cboFilterWhoDone.SelectedItems.Value) || JOB_WHO.Value = cboFilterWhoDone.Selected.Value;
     IsBlank(cboFilterPrioDone.SelectedItems.Value) || IsEmpty(cboFilterPrioDone.SelectedItems.Value) || JOB_PRIORITY.Value = cboFilterPrioDone.Selected.Value;
     IsBlank(cboFilterPartsDone.SelectedItems.Value) || IsEmpty(cboFilterPartsDone.SelectedItems.Value) || JOB_PARTS_PRESENT.Value = cboFilterPartsDone.Selected.Value
     )
     JOB_STATUS.Value = "Finished"
     );
     "Rijnummer";
     SortOrder.Ascending
     );
     JOB_PRIORITY.Value;
     SortOrder.Ascending
    )

     

    Best regards

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard