I’m trying to get a list of artistName, how can I do this? I’ve extracted the json from #serialized-server-data but I don’t know how to convert it into json so I get artistName from it
the html content from script tags should already be valid json stringified — thats what #serialized-server-data usually contains. try using a code node with JSON.parse(data) to convert it, then youll be able to access artistname directly. if the parser fails check for extra whitespace or syntax issues in the extracted string first.
Hi! I checked your workflow and the issue is actually quite straightforward once you look at how the data flows.
What’s happening
In your HTML node, you extract:
#serialized-server-data
This returns a string, not a JSON object.
So even though it looks like JSON, n8n still treats it as plain text.
Why it doesn’t work directly
The value in album is:
a JSON string
extracted from a <script> tag
not parsed yet
So when you pass it into Edit Fields, it’s still just a string → you can’t access properties like artistName.
Root cause
The problem is: data is still a string (not parsed yet)
What’s missing
There is currently no node that converts the string into JSON.
Minimal fix (no redesign needed)
Add a Code node after the HTML node:
let raw = $json.album;
// clean possible script tags (just in case)
raw = raw
.replace(/<script[^>]*>/, '')
.replace('</script>', '')
.trim();
// parse to JSON
const parsed = JSON.parse(raw);
// now you can access data
return {
json: parsed
};
After that
You can access fields like:
$json.data[0].attributes.artistName
(depending on the exact structure)
Summary
HTML node → returns string
No parsing step → main issue
Add Code node with JSON.parse() → solved
If you share a sample of the extracted album content, I can help point to the exact path for artistName.
nice breakdown @erwin_burhanudin — the script tag cleanup is a good catch. once it’s parsed, just explore the structure in the output panel first to find the exact path to artistName.