Hi,
have a requirement to short a record field which have integer value
how can i do that ?
Discussion posts and replies are publicly visible
What do you mean by "short"?
means vallue should come in ascending order
like {2,5,1,9,7}=={1,2,5,7,9}
If you have a use case to sort random integer value. You can wrap the value in a map and then apply todatasubset, where you will get sorting function for your desire output.
a!localVariables( local!data: { 2, 5, 1, 9, 7 }, tointeger( todatasubset( a!forEach( items: local!data, expression: { value: fv!item } ), a!pagingInfo( startIndex: 1, batchSize: - 1, sort: a!sortInfo(field: "value", ascending: true) ) ).data.value ))
The documentation has a ready made recipe for such a use case.
https://docs.appian.com/suite/help/23.3/Function_Recipes.html#sort-an-array
concat( "<dynamic>", a!forEach( items: local!claimEnforceActivityHoursDetail, expression: concat( "<cehdtable day='", todatasubset( a!forEach( fv!item['recordType!{f2a34aa7-07cb-4563-a36f-6f1fdceb2db8}GAI Enforcement Activity Hours.fields.{f85e426c-35aa-430b-a66b-c0698b83213a}dayOfTheMonth'], { value: fv!item } ), a!pagingInfo( startIndex: 1, batchSize: - 1, sort: a!sortInfo(field: "value", ascending: true) ) ).data.value, "' />" ) ), "</dynamic>"
day value i need to short but it is not giving the correct output after 19 ,2 is coming