-
Hello, I would like to use it to read some data for my music album collection. At this time, when I add a new album I select an artist from a list provided by a Promoted Attribute. This list show the artists last names in an alphabetical order : Now, let says that I select the artist name "Bowie, David" from my dropdown list, how can I retrieve the following information from an XML Code note to obtain the following values in a script : What would be the XML structure of note ? The idea is to set a text for a new note with David Bowie (instead of the Promoted Attribute value "Bowie, David). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
If you can choose then I recommend JSON since it's easier to work with in JavaScript. Not sure how much you already know, but once you have a note object, then getting the underlying JSON data content is simple like this: const data = note.getJsonContent();
for (const artist of data) {
console.log(artist.firstName, artist.lastName);
} Structure can be whatever you want, e.g. array of objects as used in the code sample. |
Beta Was this translation helpful? Give feedback.
If you can choose then I recommend JSON since it's easier to work with in JavaScript.
Not sure how much you already know, but once you have a note object, then getting the underlying JSON data content is simple like this:
Structure can be whatever you want, e.g. array of objects as used in the code sample.