Forum Discussion

munish's avatar
munish
New Contributor
5 years ago

String to json in pyscript

how can I convert string to json in python script snap including how to add library in pyscript?

1 Reply

  • bojanvelevski's avatar
    bojanvelevski
    Valued Contributor

    Hello @munish,

    You’ll need to import the json library. When you get the stringified json (input = inDoc.get(‘json_string’)) in the script, use the following function: json.loads(input),

    Hope this helps,
    Regards,

    Bojan Velevski