Hi there.
I got stuck changing msg.url (object) to msg.url acceptable in http request node.
What should I set msg.url to in change node?
Can I return msg.url from the function as a string?
[{"id":"ace7ea29.4b43c","type":"tab","label":"FX","disabled":false,"info":""},{"id":"ad559c0a.861c5","type":"debug","z":"ace7ea29.4b43c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1930,"y":420,"wires":[]},{"id":"204b5f33.e44e48","type":"http request","z":"ace7ea29.4b43c","name":"USDJPY","method":"GET","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":1580,"y":640,"wires":[["ad559c0a.861c5"]]},{"id":"5b29175c.b6a8c","type":"function","z":"ace7ea29.4b43c","name":"","func":"var topic = msg.payload;\nfrom = topic.substr(0, 3);\nvar to = msg.payload;\nto = to.substr(3, 6);\n\nvar url = \"https://www.alphavantage.co/query?function=CURRENCY_EXCHANGE_RATE&from_currency=\"+from+\"&to_currency=\"+to+\"&apikey=7NLFVEIFPWMVFSVJ\";\n\nmsg.payload = url;\nmsg.url = {payload: url};\nmsg.topic = {payload: url};\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1120,"y":640,"wires":[["5c1e3d60.1d97cc","ad559c0a.861c5"]]},{"id":"47f7762b.72969","type":"inject","z":"ace7ea29.4b43c","name":"","props":[{"p":"url","v":"https://www.alphavantage.co/query?function=CURRENCY_EXCHANGE_RATE&from_currency=USD&to_currency=JPY&apikey=demo","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"str","x":1310,"y":740,"wires":[["204b5f33.e44e48"]]},{"id":"bc57ee79.8b1118","type":"inject","z":"ace7ea29.4b43c","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"USDJPY","payloadType":"str","x":920,"y":640,"wires":[["5b29175c.b6a8c"]]},{"id":"5c1e3d60.1d97cc","type":"change","z":"ace7ea29.4b43c","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"msg.url","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1310,"y":640,"wires":[["204b5f33.e44e48"]]}]