Data-element types in edge extensions

A data-element-type library module retrieves a piece of data. How this piece of data is retrieved is up to you. For example, you can use a data element type to allow Adobe Experience Platform Launch users to retrieve a piece of data from the XDM layer or their custom data layer?

IMPORTANT

This document covers data-element types for edge extensions. If you are developing a web extension, see the guide on data-element types for web extensions instead.

This document also assumes you are familiar with library modules and how they are integrated in Platform Launch extensions. If you require an introduction, see the overview on library module formatting before returning to this guide.

Consider a situation where you want to allow users to retrieve a piece of data from the custom data layer. Your module may look like this:

module.exports = (context) => {
  const productName = context.arc.event.data.productName;
  return productName;
};

If you want to make the data returned for the data layer configurable by the Platform Launch user, you can allow the user to input a key name and then save the name to the settings object. The object might look something like this:

{
  keyName: "campaignId"
}

In order to operate on the user-defined local storage item name, your module would need to change to this:

module.exports = (context) => {
  const data = context.arc.event.data;
  return data[keyName];
};

Library module context

All data element modules have access to a context variable that is provided when the module is called. You can learn more here.

On this page

Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now