Sorting Results in "List Actions All Constituents" API Call

Austen Brown
Austen Brown Community All-Star
Ninth Anniversary Kudos 5 PowerUp Challenge: Product Update Briefing Feedback Task 3 bbcon 2025 Attendee Badge

I’m using the List Actions All Constituents API call in RE NXT to retrieve a specific action list. My goal is to:

  1. Sort results by date_added (newest to oldest).
  2. Limit the output to the first 15 results.

I know I could use the native connector List Actions action or run an ad hoc query for similar results, but the 15 record limit is why I’m leaning toward the API call, if I can figure out the sort_token query parameter.

Has anyone successfully done this? Any guidance would be greatly appreciated.

Best Answer

  • Austen Brown
    Austen Brown Community All-Star
    Ninth Anniversary Kudos 5 PowerUp Challenge: Product Update Briefing Feedback Task 3 bbcon 2025 Attendee Badge
    Answer ✓

    Love when I make a post… and then end up figuring out the answer myself! 😁

    Didn't figure out how to sort within the HTTP API call - looks like sort_token is related to something else. Ended up utilizing a nested expression to sort the array output from the Parse JSON action in reverse order (descending) by action date and grabbing the first 15 within the sorted array. Sharing incase anyone else can use this solution too.

    take(reverse(sort(body('Parse_JSON')?['value'], 'date')), 15)
    

Answers

  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 Facilitator 3 Raiser's Edge NXT Fall 2025 Product Update Briefing Badge

    Unfortunately limit # of output rows is only available for static query, otherwise, I would say use Query API is best, so you are not being sent too much data (potentially).

    Great job on the use of all the expressions. Sort is especially nice, only issue is, it can only work on simple data type.

  • Austen Brown
    Austen Brown Community All-Star
    Ninth Anniversary Kudos 5 PowerUp Challenge: Product Update Briefing Feedback Task 3 bbcon 2025 Attendee Badge

    Great point. Since I already was using an Action List (using filters there, not from a static query) I stuck with that route. Learned a new expression in the process, by way of ChatGPT - take().