How to assign Map sort parameter in the retrieveXPathQuery

refering to i'd like to know how to use Core.retrieveXPathQuery like this List<imendixobject> Core.retrieveXPathQuery(IContext context, String xpathQuery, int limit, int offset, Map< Sting, String> sort, int depth) how to assign map parameter how to assign type of sorting such as ascending, descending Thank you
1 answers


the key of each map pair should be the membername* on which should be sorted (example: "User.Name") and the value should be the sort direction, either "asc" or "desc". For example:

Map<String, String> sort = new HashMap<String, String>();
sort.put("User.Name", "asc");

Now you can pas the sort object to the retrieve method. (Do not forget to import java.util.Map and java.util.HashMap)

*you can use proxies for this, if applicable, for example : sort.put(system.proxies.User.MemberNames.Name.toString(), "asc")`