Nested Sort expression for HTML table?
I’m working on my very first flow and I’m using Haillie Guiseppe’s Overdue Action Audit from the template showcase (thank you, @Hallie Guiseppe!).
The flow is working perfectly, except I’d like to sort the resulting HTML table first by fundraiser and then by action due date, so the resulting table would look like this:
Using the Sort expression, I can sort by either fundraiser OR action due date, but not by one followed by the other.
If I use the Sort expression like this, the result is sorted by fundraiser of course:
If I nest the Sort expressions like this, the result is only sorted by action due date without regard to fundraiser:
Last, I tried swapping the order of the nested sort expressions like this, and the result is only sorted by fundraiser.
Any advice on how to sort first by one field, then by another?
Best Answer
-
sort()expression does not allow sorting by multiple fields, and nesting wouldn't do it as it simply will sort by fundraiser, and THEN sort by due date, the outer mostsort()expression will be the result.One way to do what you want to do is to create a sortkey that is a combination of the field you want to sort by. This is done via Select action, and then use
sort()expression.Then you can do
sort(body('Select'), 'sortkey')in your case, you want the sortkey to be fundraiser name (if you want and have the data for it, you can do fundraiser lastname then firstname, then duedate) and the due date. However, just be aware that a sortkey is going to need your date to be in yyyymmdd format to better do sorting
1
Answers
-
Might want to take a look at these two discussions:
- https://community.blackbaud.com/discussion/comment/270933#Comment_270933?utm_source=community-search&utm_medium=organic-search&utm_term=sort
- https://community.blackbaud.com/discussion/comment/305729#Comment_305729?utm_source=community-search&utm_medium=organic-search&utm_term=sort
1 -
Thank you, Dan and Alex, for taking the time to respond. I'll check out these ideas. Appreciate the help!
0
Categories
- All Categories
- 6 Blackbaud Community Help
- 206 bbcon®
- 1.4K Blackbaud Altru®
- 394 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 357 Blackbaud eTapestry®
- 2.5K Blackbaud Financial Edge NXT®
- 646 Blackbaud Grantmaking™
- 561 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 934 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.4K Blackbaud Raiser's Edge NXT®
- 3.6K SKY Developer
- 242 ResearchPoint™
- 117 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 238 The Tap (Just for Fun)
- 33 Blackbaud Community Challenges
- 28 PowerUp Challenges
- 3 (Open) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 777 Community News
- 2.9K Jobs Board
- 53 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)







