Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
10 replies
Subscribers
6 subscribers
Views
5651 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Process
Hi, I am trying to sort a text array and tried using the following recipe.
Howard
over 10 years ago
Hi,
I am trying to sort a text array and tried using the following recipe.
forum.appian.com/.../Function_Recipes.html
Since this is just an array, not a record type, I am not sure what to put in as the field name to sort on in the data input tab. When I try to put in "field" as the value, I get an error evaluating expression. Any ideas? Thanks.
An error occurred while evaluating expression: departmentNameList:todatasubset(#"_a-0000d27e-8161-8000-8fc8-0a000064044c_72737",ac!pagingInfoNodeInput2).data (Expression evaluation error at function 'todatasubset': Error evaluating function 'todatasubset' : java.lang.IllegalArgumentException: The given data type is not a record type...
OriginalPostID-124071
OriginalPostID-124071
Discussion posts and replies are publicly visible
Top Replies
Mike James
over 10 years ago
+1
Certified Lead Developer
The sorttextarray() function is part of the Sort Utilities Plugin: forum.appian.com/.../summary
Parents
0
Dan Lluhi
Certified Lead Developer
over 10 years ago
Hey, if you haven't figured it out, try something like this :
load(
local!textArray: {
"b",
"a"
},
local!tempCDT: apply(
rule!toCDT,
local!textArray
),
local!pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: -1,
sort: a!sortInfo(
field: "field",
ascending: true
)
),
todatasubset(
local!tempCDT,
local!pagingInfo
).data.field
)
rule!toCDT has one rule input called "text" (Type: Text), and is defined as:
{field: ri!text}
replace local:textArray from the first rule with the text array that you want to sort.
Basically what the code does is converts your text array to a temporary "CDT" which just has one field (called field), that way when you make your pagingInfo you can give it a field to sort on. In the example above, the result is {"a","b"}
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
Dan Lluhi
Certified Lead Developer
over 10 years ago
Hey, if you haven't figured it out, try something like this :
load(
local!textArray: {
"b",
"a"
},
local!tempCDT: apply(
rule!toCDT,
local!textArray
),
local!pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: -1,
sort: a!sortInfo(
field: "field",
ascending: true
)
),
todatasubset(
local!tempCDT,
local!pagingInfo
).data.field
)
rule!toCDT has one rule input called "text" (Type: Text), and is defined as:
{field: ri!text}
replace local:textArray from the first rule with the text array that you want to sort.
Basically what the code does is converts your text array to a temporary "CDT" which just has one field (called field), that way when you make your pagingInfo you can give it a field to sort on. In the example above, the result is {"a","b"}
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data