cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
348
Views
0
Helpful
1
Replies
no_prop4500
Beginner

DNA Templates: Variable inside a variable?

Hello and thanks for taking the time to read over my post. I'm trying to reference a Velocity variable ($Data_Vlan) inside another variable($Access_Port_Config). I'm not sure the best way to accomplish this task. I've not been able to figure it out yet and was hoping someone might point my in the right direction. Thanks in advance!

#set ($Access_Port_Config="
 description LAN
 switchport access vlan $Data_Vlan
 switchport mode access
 switchport voice vlan $Voice_Vlan
 line
 line")

 

1 REPLY 1
Kenneth.Grace
Beginner

Hey @no_prop4500,

The operation your looking for is #define, not #set. Here is my go-to resource for everything Velocity.

 

#define ($Access_Port_Config)
 description LAN
 switchport access vlan $Data_Vlan
 switchport mode access
 switchport voice vlan $Voice_Vlan
#end

$Access_Port_Config
Content for Community-Ad

This widget could not be displayed.