Forum Discussion

alibaba82's avatar
alibaba82
Super Contributor
18 years ago

property expansion

Hello,
I have a variable recId which I obtain by doing

def recId = context.expand('${DataSource_RecIds#rec_name}')

The problem is that rec_name is itself a variable. I am trying to do something like but its not working.
def recId = context.expand('${DataSource_RecIds#${rec_name}}')

What am I doing wrong.

Thanks

Ali

3 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Ali,

    hmm.. how/where is the rec_name property defined?

    regards,

    /Ole
    eviware.com
  • alibaba82's avatar
    alibaba82
    Super Contributor
    actually I am using this
    def editorialAirings = context.expand( '${Airings_Count#$foo}' )

    where Airings_Count is a 'properties' test step and foo is property in the 'properties' test step. foo keeps changing so I need to access its value dynamically.
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    ok.. so you mean you have something like

    def foo = "name of property"
    def editorialAirings = context.expand( '${Airings_Count#$foo}' )


    ?

    In that case I suggest you do

    def editorialAirings = context.expand( '${Airings_Count#' + foo + '}' )


    instead. Does that help?

    regards!

    /Ole
    eviware.com