--- title: "SetLocalVariable" slug: "setlocalvariable" updated: 2024-05-04T19:50:49Z published: 2024-05-04T19:50:49Z canonical: "help.mail-and-deploy.com/setlocalvariable" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.mail-and-deploy.com/llms.txt > Use this file to discover all available pages before exploring further. # SetLocalVariable ### General The *SetLocalVariable* function sets the value of a local variable with the given name to the given value. ### Syntax The syntax of the *SetLocalVariable* function is: SetLocalVariable Function Syntax SetLocalVariable("variable_name", ) ### Examples The following [Expression](/release34/docs/introduction-to-mail-and-deploy-expressions) sets the local variable *vYear* with the value of the variable *vMaxYear* of a [Datasource](/release34/docs/introduction-to-datasources) named *Consumer Sales*: SetLocalVariable Function Example SetLocalVariable( "vYear", [Datasource].[Consumer Sales].[Variable].[vMaxYear])