How to Sorting Repeating Group by item in another table

I have two related tables (Business Rules and Risk Analysis) The two are already properly related to each other.
In the Repeating Group with risk analysis content type, I want to sort by the item in the Business Rules table.
Is it possible to do that?

This can be counterintuitive, but here is the solution :

  • In your Repeating Group, instead of having “Risk Analysis” as “Type of content”, you must have “Business Rule”
  • So the Data source expression is : “Search for Risk Analysis’s Business Rule:sorted by XXX” (here, you can use a filter on “Search for Risk Analysis” to select the Risk Analysis you’re looking for) ; and you can sort as wanted by Business Rule
  • And then, in the RepeatingGroup cell, you have to retrieve the Risk Analysis from the “Curent cell’s Business Rule” using a Group of type Risk Analysis and having this Data source : “Search for Risk Analysis” with constraint as “Business Rule field = Current cell’s Business Rule”

And tadaaa :slight_smile:

(Tanks to Delphine and Thierry from Ottho for the clues which bring us to this solution ;))

1 Like

The easisest way to do it is to use hiding rules and custom states.

  1. When user chooses an item in the Business rules RG, set custom state on the page with type = Business rule and value = this Business rule (if you have this thibg in your db)

  2. Add hiding rule on the group withing Risk analysis RG in conditionals tab that says "If [your custom state name] dosn’t contain this risk analysis - this element is not visible.

This way your user will see only risk analysis types that belong to selected business rule.

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