Ask a Question

How to use a variable within the context.expand string (groovy)

davidp_1
Occasional Contributor

How to use a variable within the context.expand string (groovy)

I'd like to pass in a variable to the following command within a groovy script, in order to take advantage of the 1.7 functionality with respect to iterations on data sources:

 

context.expand('${Roster#startDate::0}')

 

where "0" would be replaced by an integer value (String or int, doesn't matter as long as it works). 

 

This is probably a basic groovy question but I can't seem the get the right combination.

 

Thanks!

1 REPLY 1
MFagerlind
Staff

Assuming that you have some value in the variable myValue, this would insert the value into the property expansion in lieu of 0:

 

context.expand('${Roster#startDate::' + myValue + '}')

 

Kind regards,

Manne, Ready! API Developer

cancel
Showing results for 
Search instead for 
Did you mean: