Forum Discussion

richie's avatar
richie
Community Hero
6 years ago
Solved

Bit of Groovy (I'm almost there!) to grab a bit of the string value (like substring)

Hey fellas,     as my recent posts have indicated - I have a get request hitting a ReferenceData database that lots of different projects will use.  So the GET request's query parms represent c...
  • Lucian's avatar
    6 years ago

    You can't just pick up variables like that in a groovy script. You need to expand the values.

     

    So instead of

    def namePropertyvalue = ('${Properties 1#Name}')

    use

    def namePropertyvalue = context.expand( '${Properties 1#Name}' )
  • Lucian's avatar
    Lucian
    6 years ago

    You need to expand the values.

     

    So instead of using:

    def namePropertyvalue = ('${Properties#Name}')

    you should be using:

    def namePropertyvalue = context.expand( '${Properties#Name}' )