Question Most Common
In Appian, suppose you have a list of a!map objects with fields name and id. How can you sort this list alphabetically by the name field?
Answer
We can use "todatasubset()" to sort map list or complex list
Code:
a!localVariables(
local!data: {
a!map(id: 1, name: "Interface"),
a!map(id: 2, name: "Process Model"),
a!map(id: 3, name: "Records"),
a!map(id: 4, name: "Data type"),
},
todatasubset(
local!data,
a!pagingInfo(
startIndex: 1,
batchSize: - 1,
sort: a!sortInfo(field: "name", ascending: true())
)
).data
)
Output:
JuniorSeniorExpressions#coding#sailcoding
Loading comments...