Expand my Community achievements bar.

List Var value not populating in AEP Web SDK Implementation

Avatar

Level 2

Hi All,

I used to implement list var and capture in app measurement like this but it is not working in similar fashion with AEP Websdk implementation. Can anybody help me here -

Issue - 

Listvar1 values are not populating in workspace, it is coming as undefined. .

 

I have attached all the relevant screenshots -

1. Data layer structure

Parth_Gupta_4-1724248276824.png

 

 

2. Server Call logs 

Parth_Gupta_3-1724248262828.png

 

3. ListVar is enabled in admin console as well.

Parth_Gupta_0-1724248197510.png

 

4. XDM Mapping in Data Element, Data Element is also created properly.

Parth_Gupta_2-1724248241135.png

 

5. Dashboard Screenshot.

Parth_Gupta_1-1724248223915.png

Thanks,

1 Reply

Avatar

Level 9

Hi @Parth_Gupta 

check your screenshot, list1 is actually meant to contain an array named "list" with the individual items, each of the form (and don't ask me why Adobe made it so complicated)

 

 

{
  "value": "some value"
}

 

 

bjoern__koth_1-1724265255834.png

 

 

With your sample string (parts of it, I was too lazy to replicate the whole), a list1 data element could look somewhat like this

 

 

// customDimensions.lists.list1.list
let list1 = {
    list: []
};

// you will likely use a _satellite.getVar to access the string value
const listData ="cif_2|accountNumber_108|sourceChannel_Branch|sourceChannel_API banking|sourcechannel_businessONLINE";

// break the string into an array of strings and create an object with a value key for each item
listData.split("|").forEach(item => list1.list.push({value: item}));

return list1;

 

Hope that helps