Parsing reference data from input form screen

Robin Hearne
Tera Expert

I have created an Input form screen with a Reference input which allows multiple selections and I'm having issues accessing the sys_ids of the selected records in my Query condition script.

 

The Input type for the Input record is 'Reference'.  The Type of the Data parameter is 'String.

When I log the input value to the system log it appears similar to the following:

[Ljava.lang.String;@690ecd97

From my research I believe that this means that it is an array of class java.lang.String but I have not been able to find any way to convert this into a regular array or indeed any other output that enables me to read the contents of the array.

I wonder if it's occurring because of the type mismatch between the Input and the Data parameter but there aren't any obvious alternatives.

 

Is any one able to tell me how to resolve this?

 

Thanks in advance.

 

Robin

8 REPLIES 8

AshishKM
Kilo Patron
Kilo Patron

Hi @Robin Hearne ,

Are you referring that, you created a list collector type field on form which is getting the data from mapped tabled and when you selected multiple values and now trying read the selected valued from list collector variables, if yes, please share the code you have written for this.

 

-Thanks,

AshishKM


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

I am using an 'Input form screen' (sys_sg_parameter_screen) in a Mobile App.

Juhi Poddar
Kilo Patron

Hello @Robin Hearne 

This error comes because the value being returned is a Java string, and we are trying to process it as a javascript string. So the solution is to convert it into a JavaScript String using the following syntax:

var newString= String(oldString).valueOf();

To know more please refer to this post: Error Ljava.lang.String;@

Hope this helps!

 

"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"

 

Thank You
Juhi Poddar

Robin Hearne
Tera Expert

Thanks for the suggestion @Juhi Poddar but it didn't work unfortunately.

I tried this to validate:

var plan= String(input.maintenance_plan).valueOf();
gs.info('Robin: ' + plan);

and the output was:

Robin: [Ljava.lang.String;@26bdb5c3