Sorting Repeating Group with Different Dropdown Values

I have a Repeating Group that contains apartments. I have a dropdown that I’d like to use to sort the Repeating Group by various attributes, such as Price (High to Low), Price (Low to High), Ratings, Recently Added, Walking Distance, etc.

While trying to solve this problem, I came across this post: Sort a repeating group with dropdown. It became clear to me that the Repeating Group can be dynamically sorted by the dropdown’s value, but only if the value perfectly matches one of the apartment’s properties. However, I cannot/don’t want to do this for two reasons:

  1. Walking Distance is not a property of the apartment. Instead, it is calculated and dynamically changed on the apartment listing card according to a location the user inputs as a point of interest.
  2. Things like Recently Added, Price (High to Low), Price (Low to High), Highest Rating don’t make sense to be apartment property name’s.

As a workaround, I tried making an invisible input field that would serve as the dynamic field for the repeating group to sort by. I was planning on making the input field’s value change according to the dropdown’s value, but couldn’t figure out how to do so. Additionally, this wouldn’t solve my Walking Distance problem or the High to Low vs Low to High problem.

If anyone has any ideas on how to solve this, it would be greatly appreciated. Let me know if you need any more details. Thanks a bunch!

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