Help converting YAML to JSON

I am having trouble converting this working YAML automation into JSON to place in a service call node. I know the YAML already has some JSON in it, so I think theres what I am getting confused.

Heres the yaml:

Heres what i am putting in the play_media service call node:

And I get this error:
image

Based on the error try a json string…
"media_content_id": "{\"library_name\": \"Fuller\",...

1 Like

Or to make it easier for people to not make mistakes getting slashes etc in the wrong place:

JSON.stringify({
existing JSON in media_content_id
})

https://www.convertjson.com/yaml-to-json.htm

1 Like

Can you elaborate on this? Im kinda confused.

Thx that did the trick!

I had used that but I was my own worst enemy. I thought I had to take the existing JSON out of the YAML before using that convert tool! lol

{  
     "media_content_type": "EPISODE",
     "media_content_id": JSON.stringify({
         "library_name": "Fuller",
         "show_name": "Fuller House",
         "season_number": 1,
         "episode_number": 1
     })
}

The idea being that the JSON is converted to a string (hence stringify) for you.

1 Like