Set Tag
5 min
the set tag is an internal variable tag that allows you to declare a variable name, assign it a value, and use the named variable elsewhere in the template the name of this variable can subsequently be used in other tags as a relative data reference, using ${name} this is different from the query tag in that it sets a string to the value, not a dataset the purpose of this tag is to create a value that can be referenced by other tags while it can be used in other ways under some of the data providers, its results are not guaranteed for any other use attributes var (required) sets the name to use for this variable value (optional) sets the value to use for this variable evaluate (optional) evaluates an expression and returns the result examples search and replace in the following example, any use of $ in a tag will be converted to dave this is a pure text search & replace \<wr\ set var="name" value="dave"/> you can now also evaluate a statement this returns the results of an expression in the example below, anywhere you use ${name} it is changed to 15 \<wr\ set var=’name’ evaluate=’3 5’/> another outcome of an evaluate is true or false in the example below, anywhere you use ${name} it is changed to true \<wr\ set var=’name’ evaluate=’3 < 5’/> deleting a set to delete, call with no value \<wr\ query var="name"/> once deleted, you may no longer use ${name}