Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
DM_J
Contributor II
Contributor II

cannot convert from object to string tMap

I have a tJavarow and immediately after that there is tMap

 

tJavarow has this code:

java.util.List<String> items = new java.util.ArrayList<String>(java.util.Arrays.asList(input_row.Address.split("\\|")));
output_row.add_list = items;

 

tMap has this code:

Var.address_cat == -1?row13.add_list.get(0).toString():row13.add_list.get(2).toString()

 

before adding toString I got cannot convert from object to string  error.

My question is why I need to add toString, I've already defined List<String>?

 

 

Labels (3)
1 Solution

Accepted Solutions
vapukov
Master II
Master II

Hi,

 

this is just a Java rules

List<String> is not equal to String

 

some examples:

https://www.geeksforgeeks.org/convert-list-of-characters-to-string-in-java/

View solution in original post

1 Reply
vapukov
Master II
Master II

Hi,

 

this is just a Java rules

List<String> is not equal to String

 

some examples:

https://www.geeksforgeeks.org/convert-list-of-characters-to-string-in-java/