Hi,
BELOW Is SORT where we used
a!save(local!a,
index(sort(somevalue)),1,Null)
Now after upgrading im getting error in interface invalid function {"SORT"}
WHAT is the replacement of SORT NOW
Discussion posts and replies are publicly visible
nussamramreddy Actually we can use a!sortinfo function only be referenced by the PagingInfo and DataSubset types so if you want the use the sorted data, query the data and sort by your specified value and save in local variable (eg: local!sortData) then use your local variable as below a!save(local!a,index(local!sortData,1,null))
Sort() is an undocumented function and should not be used. Instead, you can convert your data into a data subset using todatasubset() function and then use the sort parameter in the paging info using a!sortinfo.For your reference: https://docs.appian.com/suite/help/24.4/fnc_scripting_todatasubset.html#examples
The sort function is not documented by Appian and is not recommended for use in your code. Instead, adding to what Nilanshu said you can use todatasubset() function to sort your data by providing sortInfo, eg :
a!localVariables( local!array: { 1, 11, 9, 2, 7, 0 }, local!fieldArray: a!forEach( items: local!array, expression: a!map(id: fv!item) ), local!datasubset: fn!todatasubset( arrayToPage: local!fieldArray, pagingConfiguration: a!pagingInfo( startIndex: 1, batchSize: - 1, sort: a!sortInfo(field: "id", ascending: true) ) ), local!datasubset.data.id )