Ascending order doesn't work on RG (based on a list of things on another thing’s field)

Hi,

I’m trying to sort a repeating group with custom events AND sort the RG based on a list of things on another thing’s field but it doesn’t seem to be working in ascending order.

Can anyone else please see if you can replicate what I’m seeing?

Step-by-step instructions to replicate:

  1. Preview “index” page
  2. hover on the “Nutrient(s)” filter
  3. check “Protein” from the left column
  4. Click the “Run Search” button
  5. and it’ll show Strawberries, Walnuts, Mushrooms (that’s supposed to be in ascending order, but obviously by the food_nutrient values (as validated in the database) that’s not correct.
  6. Back in the app editor, the Custom Event / workflows that I implemented are in the color Purple.

When I switch to descending order, it appears to work.

Link to editor:

I also tried another way of displaying the RG / list within the workflow with the page named “attempt_2” - to no avail.

I’ve used the debugger and it’s setting the correct state of the nutrient e.g. Protein and it appears to be filtering correctly, it just doesn’t display in in asc. order.

Trying so desperately here to launch this app. Please help :slight_smile: Thanks

Screenshots should it be helpful:

I should also note:

Originally: I tried using a Custom Event to display a list that Searches for food’s - but because of my data structure, it wouldn’t allow me to access the field (“amount (100g)”) from the food_nutrient type. So as you suggested in "How to sort a list of Things by another Thing’s field” I’m…

Now: I’m using a Custom Event to display a list that Searches for food_nutrients’s food

I’ve tried different variations with applying “unique elements”, “filtered” and “sorted by” after the data source or within the Search itself but it will not work and it’s driving me crazy.

Am I missing something or is this a bug? How do I get it to show the field “amount (100g)” in ascending order - low to high.

Did you try to debug your RG in debug mode?
Check each result after each step to find where is the issue.

Actually it’s a little bit hard to help because you are searching Food nutrient and the RG is Food list, so the issue may be there. So I suggest you to check in debug mode if the Search for food_nutrient (not 's food) return the list sorted correctly first.

The app needs to be made pubic so we can have a look, thanks.

This topic was automatically closed after 14 days. New replies are no longer allowed.