I am trying to order a ListView based off the state of a variable set elsewhere. The ListView is showing documents in a collection and I am able to change the order in which these documents are shown based off a field of the documents in this collection, but I am looking for a way to change which field is used for the ordering.
For example, I can order the entries based off of the "date" field and the entries will then appear ordered by the date field. I want to allow users to select another option ("eg. weight") from a drop down elsewhere on the same page and then have the entries re-order themselves according to the document's weight field.
Below I have included a screenshot of the ordering options I am given when querying the collection. I am not given the option to choose the "Collection Field Name" dynamically based on a variable set elsewhere, like a page parameter for example.
Does anyone know how I can achieve this kind of dynamic ordering?