Yes, that is setting the data element.
Basically, you have two possibilities of defining data elements that are mutually exclusive
- using the Launch UX which will always require some kind of data element type (which is important, see caveat)
- using custom code like you have done here
Both types of data element can be referred to in extension interfaces through the percent syntax e.g., %my data element%
The big caveat though is
- data elements set through setVar are not accessible through a UX data element with the same name.
In other words: you cannot declare the data element via UX and then assign a value later through setVar
- If you need to write custom code to define the value of a data element, use a Custom Code data element instead
Cheers from Switzerland!