So I’m trying to link daily.co with n8n to create a new room (with a random name) and an owner token.
I’ve got a “http request” running which creates the room and outputs the name and URL etc. I’m then linking that to another “http request” which creates a new token for that room.
The issue I’m having is the variable isn’t inputting into the json, the expression I have is here which sends successfully to daily.co.
This doesn’t look like a valid expression to me, so tbh I am surprised you could send this in the first place. The problem here will be that n8n considers the first occurence of }} to be the end of your expression, treating everything afterwards like a string.
If you want to send a valid JSON object with a properties field (which itself is a JSON object with properties such as room_name and is_owner) you could do this instead:
By handling this as a JS object you can avoid having to build a suitable string yourself with a mix of expression and non-expressions parts in the same field. You can see in n8n’s expression preview how the room_name field is populated as expected:
The first {{' opens the json so I figured what if I close the json with a '}} after the "room_name":" then insert the $json.name variable then open the json again with the {{' and finish the syntax then close it again! Bam, working!