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
7 subscribers
Views
4464 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
Saving array into array
Evan Rust
over 8 years ago
Hello, when saving an array of integers into a field in CDT array, I am seeing that the first value of the integer array is getting repeated, rather than the array being saved element-by-element.
For example if I print testcdt.id after executing a!save(testcdt.id,{1,2}) I am seeing {1,1} as the values in testcdt.id rather than {1,2}. Am I overlooking something, or is there a problem with my environment? Using Appian 16.3.
OriginalPostID-245995
Discussion posts and replies are publicly visible
0
abhinavg712
Certified Lead Developer
over 8 years ago
Evan, is the id field multiple/array type? I have attached the results using v16.3, if possible do share the sail code.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 8 years ago
@abhinavg This is the scenario being conveyed by the user who made the post:
1. Make the testcdt rule input as multiple. Let's say it has two records. Populate it with an array as follows in the Test Inputs: {type!testcdt(integerField:1),type!testcdt(integerField:2)}
2. Now try to save the new values into 'integerField' field as follows:
a!save(ri!testcdt.integerField,{3,4})
You will see 3,3 being pushed into the integerField of testcdt.
@evanr May be you can do something like this:
a!save(
\tri!testcdt,
\tapply(
\ ttype!testcdt(
\ tid:_
\ t),
\ t{3,4}
\t)
)
I don't think there is any problem and as far as I remember, there are few forum posts on this topic.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
abhinavg712
Certified Lead Developer
over 8 years ago
@sikhivahans, I was thinking in terms of a unary operation.
BTW, using a looping function with type constructor as suggested by you above will get the desired result. Thanks for the correction!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel