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
yashag2255
Dual Super User II
Dual Super User II

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
yashag2255
Dual Super User II
Dual Super User II

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

That worked thank you!!

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,806)