Load panel list using JS | XM Community
Skip to main content

I am struggling to load panel list to JS array.
I am doing:
var mydata = ["${e://Field/id}","${e://Field/name}"]
alert (mydata[0][0]);
Can somebody please help?

What are you trying to achieve here?

mydata[0][0]
will give you the first character of the id field.
if you want only the id, it should be
mydata[0]

You can read more about arrays here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array

Also, while debugging, its better to use
console.log()
instead of
alert() 
as there are some restrictions on what it alert() will show. You can access the console by pressing ctrl+shift+i on chrome.


Leave a Reply