nappyjim
(Jim)
November 14, 2021, 10:58pm
1
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:
wuench
November 14, 2021, 11:34pm
2
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
})
Kermit
November 14, 2021, 11:57pm
4
1 Like
nappyjim
(Jim)
November 15, 2021, 2:46am
5
Can you elaborate on this? Im kinda confused.
nappyjim
(Jim)
November 15, 2021, 2:47am
7
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