cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
760
Views
0
Helpful
1
Replies

DNA Templates: Variable inside a variable?

no_prop4500
Level 1
Level 1

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
Level 1
Level 1

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
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: