dynamic set values of CDT fields

Certified Associate Developer

Hello community,

Is it possible to add values from a list of string of string to fields where string 1 of the list maps to field 1 of the CDT, sting 2 to field 2 of the CDT etc.
When I pass the list of strings to the CDT as a parameter in the expression it passes al the strings to field 1.
I want to make the expression dynamic, so for example looping through the list of strings and add them to CDT field 1, next CDT field 2 etc.
I do not know how to set the values of the CDT fields based on their index. All the fields in the CDT are of type text.
To illustrate for example CDT Alphabet with fields Letter1: "", Letter2: "", Letter3:"".
List of String{("A"),("B"),("C") etc.
Now I want for the length of the string, adding A B C to Letter1, Letter2, Letter3 using a Loop. (is it possible to use index of CDT field instead of fieldname?)
My second question is, is it possible to just add the whole list as a parameter when I cast it to a certain type, so that every item in the list will be seen as an individual parameter?

Kind Regards,

Erik

  Discussion posts and replies are publicly visible