cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass a list parameter from Javascript?

Former Member
0 Kudos

Hello, there!

I have a transaction that receives a list parameter. I have built an XAcute Query for it and mapped the input parameter so that I can pass it with the getQueryObject().setParam(1, myList) Javascript method.

The myList parameter is a Javascript string array.

I can see the parameter getting to the transaction (when I log it, I can see "1, 2, 3" as a result), but when I call the size(list) function, it always returns 0. Also, if I try to get an element of this list, it doesn't work.

It seems that my comma-separated input string is not being correctly transformed on an MII list.

Do you know what I should do to solve this problem?

Thanks in advance!

Accepted Solutions (0)

Answers (1)

Answers (1)

jcgood25
Active Contributor
0 Kudos

Your typical "ABC,DEF,GHI" comma separated list will need to be in a different format to be compatible with the list propery type (and be used by the corresponding functions).

Have you tried creating a TRX or local property of type List and press the evaluate button to see the string representation?

[[string:ABC], [string:DEF], [string:GHI]]

Former Member
0 Kudos

Hi, Jeremy!

Thanks for your reply.

So, if I pass a string in this format it should be regonized by the transaction as a list?

What I'm doing now is passing a comma-separated string, parsing it to a a list and then passing it as a list to my transaction.

Former Member
0 Kudos

Hi Gustini,

I found passing it like this works, I have a List datatype with 3 items in a transaction, and this is what I send to the XacuteQuery MappedParamTarget:

queryObj.setMappedParamTarget(1, "[[orange,purple,13]]");

Kind Regards,

Diana Hoppe

Edited by: Diana Hoppe on Jun 14, 2011 2:17 PM

Former Member
0 Kudos

Hi, Diana!

That's what I'm doing.

I just hoped that was some kind of "seamless" integration between the page and the transaction that wouldn't require me to do this workaroud.

Thanks for your help.