Solved
Forum Discussion
TNeuschwanger
12 months agoCommunity Leader
Hello jrziggy
It looks like this is a little trick situation... you need to expand the 'randomIndex' variable before the whole datasource reference is parameter expanded...
The context.expand is operating on a string, so just manipulate it a little bit to get your number in there instead of the variable that references it... be mindful of single quote use versus double quote use below. Simple parameter replacement occurs when double quotes are used. This sample just gets that variable replaced before the whole context.expands the full parameter.
result = context.expand( '${DataSourceStationNumber#STATION_NUM::' + "$randomIndex" + '}' );
Regards,
Todd