Populate a multi-value parameter using iLogic with a For/For Each statement

Populate a multi-value parameter using iLogic with a For/For Each statement

sergio_duran
Advocate Advocate
2,613 Views
3 Replies
Message 1 of 4

Populate a multi-value parameter using iLogic with a For/For Each statement

sergio_duran
Advocate
Advocate

Hi Everyone, 

 

This API code allows me to fill out a list with multiple values

 

SyntaxEditor Code Snippet

' Create lists of numbers and letters' by using array initializers.
Dim numbers() As Integer = {1, 4, 7}Dim letters() As String = {"a", "b", "c"}

' Iterate through the list by using nested loops.
For Each Number As Integer In numbers
    For Each letter As String In letters
        Debug.Write(Number.ToString & letter & " ")
    Next
Next
Debug.WriteLine("")
'Output: 1a 1b 1c 4a 4b 4c 7a 7b 7c

 

I want to do something similar in iLogic, how can I do it? (please see the attached image)

 

I want to create a list and fill out the multi-value parameter using a For / For each statement.

 

SyntaxEditor Code Snippet

MultiValue.SetList("d0", 0.5, 0.75, 1.0, 1.25)

I want to enter 0.5, 0.75, 1.0 and 1.25 from a previously list created.

 

Thanks!

 

 

0 Likes
Accepted solutions (1)
2,614 Views
3 Replies
Replies (3)
Message 2 of 4

Owner2229
Advisor
Advisor
Accepted solution

Hi, try this. Red Is what I've added / changed:

 

' Create lists of numbers and letters' by using array initializers
Dim numbers() As Integer = {1, 4, 7}
Dim letters() As String = {"a", "b", "c"}
Dim MyArrayList As New ArrayList
' Iterate through the list by using nested loops For Each Number As Integer In numbers For Each letter As String In letters MyArrayList.add(Number & letter) Next Next MultiValue.List("d0") = MyArrayList

 

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
Message 3 of 4

sergio_duran
Advocate
Advocate

Thanks Mike! You're the best!

 

I've just learn two new things. One of them was the iLogic snippet that is there under the Parameter snippets (6th snippet Set List from ArrayList)

0 Likes
Message 4 of 4

Owner2229
Advisor
Advisor

As always, you're welcomed Smiley Happy

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
0 Likes