Skip to Content

Groovy Script Error adding Square [] Bracket in param

Hi All,

The moment I add [](square bracket in the String param, I am unable to save the script. It keep gives me error saying that Script contain no valid function.

Removing [] square bracket from String param works fine. No clue.

Here is my script

The problem is String[] P1, If i remove the square bracket, then able to save the script. Pls help this out

error message screenshot




script.png (20.1 kB)
error.png (7.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Oct 08, 2018 at 05:09 AM

    Hi Ansari ,

    Below Script worked for me :

    Br,

    Manoj


    scn.png (15.9 kB)
    Add comment
    10|10000 characters needed characters exceeded

    • Sample xml content

      <Sales>
       <id>101</id>
       <name>XDG</name>
       <dept>4XR1</dept>
      </Sales>
      <Sales>
       <id>102</id>
       <name>ZTY</name>
       <dept>6ZY1</dept>
      </Sales>
      <Sales>
       <id>103</id>
       <name>GER</name>
       <dept>27SD</dept>
      </Sales>