cancel
Showing results for 
Search instead for 
Did you mean: 

Dereference an Attribute for Template Parameter

randybuchholz
Explorer
0 Kudos

In GTL you can pass parameters to templates, but they need to be values (no %variable% allowed). Is there a way to deference an attribute in the call? E.g., %templateTakingParams(%!table.column.Name%)%. Right now I'm creating a model-level variable before the call and using that, but it seems like a hack.

Accepted Solutions (1)

Accepted Solutions (1)

randybuchholz
Explorer
0 Kudos

Turns out you can pass variables.

Pass the variable without the percent signs. For %variable%, use %template(variable)%.

Then dereference it inside the template with %*@1%.

GeorgeMcGeachie
Active Contributor
0 Kudos

Thanks, Randy. I think this is the relevant section in the "customising and extending" PDF -

5.11.2 Passing Parameters to a Template

I'll have to try it out

Answers (1)

Answers (1)

GeorgeMcGeachie
Active Contributor
0 Kudos

You're right, you can't pass a variable to a template - I tried it recently. I had to create an extended attibute to pass instead, like you did.