cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Techgallagher
Helper I
Helper I

Sort Icon

Hey so I have a sort icon that I want to be able to sort on a specific column. 

This is the items property of the icon:

UpdateContext({SortInner:!SortInner})

This is the on visible property of the screen

UpdateContext({SortInner:Blank()})

This is the items property of the data table I'm trying to sort on with the failed formula

Search(Filter('[dbo].[970_item_format_item_mast]',If(!IsBlank(SortInner), SortByColumns('[dbo].[970_item_format_item_mast]','Inner Diameter', If(SortInner = true, Ascending,Descending)) &&
(part_name = Gallery4.Selected.PartName) &&
(outerdd.Selected.Result = 0 || outer_diameter = outerdd.Selected.Result) &&
(innerdd.Selected.Result = 0 || inner_diameter = innerdd.Selected.Result) &&
(cross_sectiondd.Selected.Result = 0 || cross_section = cross_sectiondd.Selected.Result) &&
(Heightdropd.Selected.Result = " - " || height = Heightdropd.Selected.Result) &&
(mat_compounddd.Selected.Result = " - " || material_compound = mat_compounddd.Selected.Result) &&
(mat_manufacturerdd.Selected.Result = " - " || material_manufacturer = mat_manufacturerdd.Selected.Result))
,'Part Number/Description Searchbox'.Text,"item_id","item_desc")

This is the items property of the data table without trying to add in what I thought would work for sorting

Search(Filter('[dbo].[970_item_format_item_mast]',
(part_name = Gallery4.Selected.PartName) &&
(outerdd.Selected.Result = 0 || outer_diameter = outerdd.Selected.Result) &&
(innerdd.Selected.Result = 0 || inner_diameter = innerdd.Selected.Result) &&
(cross_sectiondd.Selected.Result = 0 || cross_section = cross_sectiondd.Selected.Result) &&
(Heightdropd.Selected.Result = " - " || height = Heightdropd.Selected.Result) &&
(mat_compounddd.Selected.Result = " - " || material_compound = mat_compounddd.Selected.Result) &&
(mat_manufacturerdd.Selected.Result = " - " || material_manufacturer = mat_manufacturerdd.Selected.Result))
,'Part Number/Description Searchbox'.Text,"item_id","item_desc")
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Techgallagher 

 

Can you try to update the expression to:

SortByColumns(Search(Filter('[dbo].[970_item_format_item_mast]',
(part_name = Gallery4.Selected.PartName) &&
(outerdd.Selected.Result = 0 || outer_diameter = outerdd.Selected.Result) &&
(innerdd.Selected.Result = 0 || inner_diameter = innerdd.Selected.Result) &&
(cross_sectiondd.Selected.Result = 0 || cross_section = cross_sectiondd.Selected.Result) &&
(Heightdropd.Selected.Result = " - " || height = Heightdropd.Selected.Result) &&
(mat_compounddd.Selected.Result = " - " || material_compound = mat_compounddd.Selected.Result) &&
(mat_manufacturerdd.Selected.Result = " - " || material_manufacturer = mat_manufacturerdd.Selected.Result))
,'Part Number/Description Searchbox'.Text,"item_id","item_desc"),'Inner Diameter', If(SortInner = true, Ascending,Descending))

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

2 REPLIES 2

Hi @Techgallagher 

 

Can you try to update the expression to:

SortByColumns(Search(Filter('[dbo].[970_item_format_item_mast]',
(part_name = Gallery4.Selected.PartName) &&
(outerdd.Selected.Result = 0 || outer_diameter = outerdd.Selected.Result) &&
(innerdd.Selected.Result = 0 || inner_diameter = innerdd.Selected.Result) &&
(cross_sectiondd.Selected.Result = 0 || cross_section = cross_sectiondd.Selected.Result) &&
(Heightdropd.Selected.Result = " - " || height = Heightdropd.Selected.Result) &&
(mat_compounddd.Selected.Result = " - " || material_compound = mat_compounddd.Selected.Result) &&
(mat_manufacturerdd.Selected.Result = " - " || material_manufacturer = mat_manufacturerdd.Selected.Result))
,'Part Number/Description Searchbox'.Text,"item_id","item_desc"),'Inner Diameter', If(SortInner = true, Ascending,Descending))

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

That worked thank you!!

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (3,960)