Using the For Each activity node with a multidimensional array as input

 2 Replies
 2 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
agersh
Veteran Member
Posts: 81
Veteran Member
New Poster
New Poster
Congrats on posting!

I have a multidimensional array declared in my Start node named “arrOwesMoney”.

 

Using the following Assign node JavaScript expression to fill the array,   

 

arrOwesMoney.push(

                                      {Contact: '',

                                       EID: '',

                                       EmpName: '',

                                       Position: '',

                                       TermDate: '',

                                       Type: '',

                                       BeginDate: '',

                                       EndDate: '',

                                       OrgAmt: } );

  

Once I have completed filling the array.  I am trying to use a For Each activity node to loop through the array. To test my For Each loop named “ForEach2440” I have a MsgBuilder node which I am trying to access the values of the array. I have been unsuccessful in accessing the values using the ForEach2440_arrayValue property. The Infor Process Designer Help does not provide an example. Can anyone help me with the correct syntax?

Tim Cochrane
Veteran Member
Posts: 154
Veteran Member
hard to tell, since can't see how you defined the array or what you're trying to do in a MsgBuilder. I haven't used the for each node yet.

I've done similar...using pipe separated, tilde delimited strings...looping thru using a branch and a counter. When i'm at the point of pulling individual fields out of the string i'll assigning the field to a local var within the js, THEN assign the local var to a global var outside of the js. This makes the value available to the work unit.

Ex:
js function - inDataArray = inData.split("~"), var x1 = inDataArray[0]

followed by "r1 = x1" as a normal assignment.

This works for my situation in a number of flows I've created.
Tim Cochrane - Principal LM/IPA Consultant
John Henley
Posts: 3364
New Poster
New Poster
Congrats on posting!
Engaged Reader
Engaged Reader
You are an engaged reader!
Avid Reader
Avid Reader
Avid Reader art thou!

see attached sample

Attachments
Thanks for using the LawsonGuru.com forums!
John