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
3 replies
Subscribers
8 subscribers
Views
5389 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Cast multiple type into single
erick258
over 8 years ago
Hi, is there a method to obtain the type of a certain multiple variable? Say ri!a, which is a multiple text variable, I want ri!b to have the same type of ri!a but not multiple that is a text variable. I found out that it can be done by typename(typeof(ri!a)-1) for a CDT type, but the same doesn't work for appian primitive data type. Any suggestion? Thanks
OriginalPostID-246569
Discussion posts and replies are publicly visible
Parents
0
sikhivahans
over 8 years ago
@erick I am not sure if it's a standard way but you can give it a try as follows:
Type number of Number Integer = 1, Type number of Number Integer Multiple = 101
Type number of Number Decimal = 2, Type number of Number Decimal Multiple = 102
Type number of Text = 3, Type number of Text Multiple = 103
Type number of Boolean = 26, Type number of Boolean Multiple = 126
If you observe the pattern above, the difference between single value and an array is always 100. I believe this holds well for Primitve Data Types.
Even the following will do the job for Primitve as well as Complex data types as long as the array holds a value and is not null:
fn!typename(fn!typeof(fn!index(ri!input,1)))
/*Should work provided if you are not trying to take the data type of Input as Any Type and trying to implement a generic rule.*/
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
sikhivahans
over 8 years ago
@erick I am not sure if it's a standard way but you can give it a try as follows:
Type number of Number Integer = 1, Type number of Number Integer Multiple = 101
Type number of Number Decimal = 2, Type number of Number Decimal Multiple = 102
Type number of Text = 3, Type number of Text Multiple = 103
Type number of Boolean = 26, Type number of Boolean Multiple = 126
If you observe the pattern above, the difference between single value and an array is always 100. I believe this holds well for Primitve Data Types.
Even the following will do the job for Primitve as well as Complex data types as long as the array holds a value and is not null:
fn!typename(fn!typeof(fn!index(ri!input,1)))
/*Should work provided if you are not trying to take the data type of Input as Any Type and trying to implement a generic rule.*/
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data