- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
Hello,
how can i add an ID to a list of arrays?
Right now i am trying to do it with the function b.badge_collection_list.push("1001"). The list of arrays is called "badge_collection_list" in a "Set Data Values" Extension via JS Code. But not even the Extension is loaded on the site.
Would be nice to hear some of your ideas!
Thank you very much
Best regards
Fabian
@Fabi That is the correct JavaScript syntax to push an element onto an array, so there must be something else that is preventing it from working.
Notice that the value returned from push()
is the new length of the array. Are you assigning this value back to the array in the Set Data Value extension?
What is the scope of the extension?
You mentioned:
But not even the Extension is loaded on the site.
Did you publish your changes? Is your site loading the universal tag? If so, which publish environment?
A screenshot of the extension might make it easier to troubleshoot.
Copyright All Rights Reserved © 2008-2023