Query params to JSON

Hey @ToxicFi7h, this sounds like a problem with your code rather than n8n. From taking a look at the Node.js documentation you probably want to do something like this:

const url = require('url');
let params = new url.URLSearchParams('abc=foo&def=%5Basf%5D&xyz=5');

Also, the Function Item node would need to return a JSON object, for example by running something like this:

return {
  myParameter: params.get('abc')
};

Here’s an updated workflow doing the trick:

Result:

Hope this helps!

1 Like