Saving array into array

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

Parents
  • @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.
Reply
  • @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.
Children
No Data