cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tonykiefer
Super User
Super User

Sort gallery items with additional filter

I have a gallery of sorted items by id.

tonykiefer_0-1658851963602.png

 

The gallery items are loaded in a temporary list called items so row numbers can be counted then shading is applied to every other row.

 

The problem...If the BOM Approved is set to "Y" and IF the user clicks the check box for "View Current Styles", THEN any gallery item with the BOM Approved value of "Y" should be hidden from view.

 

I'm already sorting by one column using the search box and I'm not certain how to modify the code for the new requirement.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
tonykiefer
Super User
Super User

I solved the issue...

 

I used a preceding If to evaluate the checkbox.value.  If value true, filter by the approved column, else...additional filter.

 

With({_items: If(ViewCurrentStyles_Checkbox.Value=true,SortByColumns(Search(Filter(PLMStyleSetupHeaderDetails,Approved=Blank()) , TextSearchBox1.Text, "D365StyleId"), "StyleID"),Filter(PLMStyleSetupHeaderDetails,Approved="Y"))},
ForAll(Sequence(CountRows(_items)),
Patch(Last(FirstN(_items, Value)),
{RowNumber:Value}
)
)
)

View solution in original post

1 REPLY 1
tonykiefer
Super User
Super User

I solved the issue...

 

I used a preceding If to evaluate the checkbox.value.  If value true, filter by the approved column, else...additional filter.

 

With({_items: If(ViewCurrentStyles_Checkbox.Value=true,SortByColumns(Search(Filter(PLMStyleSetupHeaderDetails,Approved=Blank()) , TextSearchBox1.Text, "D365StyleId"), "StyleID"),Filter(PLMStyleSetupHeaderDetails,Approved="Y"))},
ForAll(Sequence(CountRows(_items)),
Patch(Last(FirstN(_items, Value)),
{RowNumber:Value}
)
)
)

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (4,105)