Sorting Data in a Dynamic Table - Need blank rows forced to the bottom after the sort. | Community
Skip to main content
nowackem
New Participant
December 18, 2020
Solved

Sorting Data in a Dynamic Table - Need blank rows forced to the bottom after the sort.

  • December 18, 2020
  • 2 replies
  • 2614 views

Hello All,

I have successfully utilized the sort table function within a dynamic table using the John Brinkman Sales Report file. It works beautifully, the magic is in the Variables script. It would be amazing to take this one step further and update the code to always list any blank rows at the bottom of the table no matter if the sort is ascending or descending. John's script does not account for this so if anyone can help me tweak this code to make that happen, I would be eternally grateful. 

My Designer PDF is located at the link below.

https://drive.google.com/drive/folders/1Qhz-DNYM40ECzUGEl2w34egEzhKBaaoV?usp=sharing

Thank you in advance!

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Kosta_Prokopiu1

I think I found a solution that works for different field types. If you want numeric input to be sorted numeric then your field must be Number or Decimal - otherwise it will sort as text.

https://documentcloud.adobe.com/link/review?uri=urn:aaid:scds:US:68787b63-a702-4977-b0c6-4968490fdfc9

2 replies

Kosta_Prokopiu1
Kosta_Prokopiu1Accepted solution
Employee
January 22, 2021

I think I found a solution that works for different field types. If you want numeric input to be sorted numeric then your field must be Number or Decimal - otherwise it will sort as text.

https://documentcloud.adobe.com/link/review?uri=urn:aaid:scds:US:68787b63-a702-4977-b0c6-4968490fdfc9

nowackem
nowackemAuthor
New Participant
January 26, 2021
Thank you so much for your help! This worked perfectly!
Kosta_Prokopiu1
Employee
January 22, 2021

Hi,

here is a bit of a hack that seems to do what you want based on the existing logic. Try it out by replacing the sortRoutine in the script object.

... the solution would not work under all circumstances - see my sample in a later post.

 

nowackem
nowackemAuthor
New Participant
January 22, 2021
Thank you so much! I appreciate your time. I replaced the sortRoutine script and realized when testing that it didn't force the blank rows to the bottom so if you have any ideas on what I can do differently I would love to hear them. Unfortunately using this updated script or my original script is crashing Designer in the HTML preview. Any advice or thoughts on how to make this work in both PDF/XDP and HTML for AEM would be appreciated.