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
+1
person also asked this
people also asked this
Replies
4 replies
Subscribers
9 subscribers
Views
6793 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
How can I use cast() in an expression to cast something to an array of a CDT? I
Jason Ruvinsky
Certified Senior Developer
over 11 years ago
How can I use cast() in an expression to cast something to an array of a CDT? I can cast to a single version of the CDT with cast('type!{namespace}type-name',{fieldName:ri!fieldName}) How can I do this with multiples?
I've been browsing the docs, if there is a good page that explains this I would appreciate the pointers. I think that cast() documentation could be enhanced with some additional examples, too. Thanks!...
OriginalPostID-91434
OriginalPostID-91434
Discussion posts and replies are publicly visible
0
Patty Isecke
Appian Employee
over 11 years ago
Can you use the apply() function to cast each element in your array?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Jason Ruvinsky
Certified Senior Developer
over 11 years ago
As an example: I have a Rule that takes an array of a CDT as a parameter, however I have to specify "Any Type" for the parameter. If I want to explicitly cast it to the array of the CDT before using it in the rule, is there a way to do this? I could do it for a singular CDT as
=with(a:cast('type!{namespace}type-name',{ri!myCDTParameter}), expression_that_uses_the_cdt)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
robbier
over 10 years ago
This is pretty much the same issue that I just posted a question about..was there ever any resolution to this?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Jason Ruvinsky
Certified Senior Developer
over 9 years ago
It looks like in Appian 7.9 you can now explicitly declare CDTs as the inputs in a rule, so you don't need to use "Any Type" any longer.
I'm not sure about casting an array of a type, although you can use typeof() to cast to the type of something you know is what you want.
Cancel
Vote Up
-1
Vote Down
Sign in to reply
Verify Answer
Cancel