Forum Academy Marketplace Showcase Pricing Features

Accessing field in javascript is throwing an error

I have a text field called data in an object called block.

I access this field in the javascript using the following code
let a =“Search for Blocks:first item’s data”;
Now if data contains normal text like this is text, javascript runs properly, but when the data has a json like [{“target”:"(L)Location",“param”:"(Cy)City"}] I get following error

run_debug.js:349 Bug in custom code SyntaxError: Unexpected identifier ‘target’
at eval (PLUGIN_1488796042609x768734193128308700/Toolbox-action–Run-javascript-.js:3:395)
at root (

Can someone let me know why this is happening?

This works fine if I replace
let a =“Search for Blocks:first item’s data”;
let a =Search for Blocks:first item’s data;

for JSON stored as text but fails for simple text