List in descending order

Good morning! My friends, I would like to put a list in descending order using the “DATE OF VISIT” field. To do so, I am using the following formula.
SORT_BY_KEY_CASE_SENSITIVE(data[“Visitor Registration”], data[“Visitor Registration”][0].dtvisita,“asc”)
However, the list does not change. Could any friend give some guidance?


I tried like this too
SORT_BY_KEY(data[“Visitor Registration”], data[“Visitor Registration”][0].dtvisita,“asc”)

Try this formula:

ORDER(data.VisitorRegistration, item.dtvisita, "desc")

Note, when you use the data[“Visitor Registration”][0].dtvisita expression you basically tell it to sort the item at the position 0 of the array. Which is not the array. Using the sort_by_key… formula would be something like this:

SORT_BY_KEY_CASE_SENSITIVE(data.VisitorRegistration, "dtvisita", "desc")

Thank you my friend.