Java Snippet - getCell where value is a list

Hi Folks

I’m dynamically accessing values using the getCell method.

However i hit a snag when the value in the cell is a list.

It returns a string “[val1, val2]”

i resolved this in a long winded way:

f = getCell(“find”, tString);
f = f.replace("[", “”).replace("]","");
g = f.split(",");
logWarn(g[0]);
Is there a more elegant solution?

What are you providing as the second argument to the getCell method? The way I’ve done it won’t work with mixed cell types but if you’ve got a collection cell containing strings you could try:

INFO Java Snippet 2:4 [a, b, c]
INFO Java Snippet 2:4 Java Snippet 2:4 End execute (0 secs)
INFO Java Snippet 2:4 [a, b, c]
INFO Java Snippet 2:4 a
INFO Java Snippet 2:4 b
INFO Java Snippet 2:4 c
INFO Java Snippet 2:4 Java Snippet 2:4 End execute (0 secs)

3 Likes

That’s what i was looking for, i had tried very similar to what you did, but it kept asking for a “.class” - the way you did it seems to resolve that.

Thank you

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.