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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,349)