Custom Code to define data elements | Community
Skip to main content
mubarakd5726232
New Participant
November 16, 2018
Solved

Custom Code to define data elements

  • November 16, 2018
  • 1 reply
  • 2454 views

New to launch and struggling to find any documentation/clarification with the following ..I suspect it's using custom code but no info on how to set the value.

Looking to define custom data elements to then use to populate prop/evars eg.

How would I define pagename element which simply takes the first element from the path and  appends with another string value or similarly checks for hostname and modifies

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Gigazelle

You can access custom variables inside the s object. For example:

s.eVar1 = 'My custom value';

You can access data elements using the _satellite.getVar() method. So to assign a data element to an eVar in custom code:

s.eVar1 = _satellite.getVar('custom data element');

More information on getVar can be found here:

https://docs.adobelaunch.com/client-side-information/launch-object-reference#launch-object-reference

1 reply

Gigazelle
GigazelleAccepted solution
Employee
November 27, 2018

You can access custom variables inside the s object. For example:

s.eVar1 = 'My custom value';

You can access data elements using the _satellite.getVar() method. So to assign a data element to an eVar in custom code:

s.eVar1 = _satellite.getVar('custom data element');

More information on getVar can be found here:

https://docs.adobelaunch.com/client-side-information/launch-object-reference#launch-object-reference