Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

The 1st edition of the Target Community Lens newsletter is out now! Click to the right to find all the latest updates

Working with Json Arrays in a Profile Script


Level 2

I am starting with Adobe Target and I would like to understand some weird things I see playing with the profile scripts.

I am creating and storing a simple list of objects containing. the objects contains just two attributes: one is an string and the other one is an integer.

When I try to get this back from the user parameter the first thing that I see is that the Json is not in a Json format anymore as it changes the ":" with "=", the other thing I see is that the integers has been converted into float.

An example of this would be:

Before storing the parameter: [ { "stringItem" : "item1", "intItem" : 12 },   "stringItem" : "item2", "intItem" : 24 }]

When I get the stored parameter: [ { "stringItem" = "item1", "intItem" = 12.0 },   "stringItem" = "item2", "intItem" = 24.0 }]

And after this I cannot longer work with the attibutes inside, actually I can't event do simple things as trying to get the type of that array element typeof(array[0])

Is there anyone that can explain me how to work with objects stored inside user parameters?



0 Replies