How do I return an item in one step and use it in the future step?

This topic was automatically generated from Slack. You can find the original thread here.

Tim Kracht : Trying to use a return item in one step as a variable in a next step url: https//www.somewhere.com/${returnvalue.$something.whatever}/morestuff

Dylan Sather (Pipedream) : Are you seeing a specific error?

Are you trying to use that syntax in a param you’re passing to a step, or within the Node.js code of the step itself?

Tim Kracht : It’s in the code I wrote, it’s part of my discord DM question I ask earlier, I got it to do the first step which is to create the dm channel, it returns a user ID channel. I am then using it in the next step as part of the url

Tim Kracht :

Dylan Sather (Pipedream) : Is it not returning the value you expect?

Tim Kracht : I am getting a error request failed with status code 400. I wanted to make sure I was doing the. Variable correct

Dylan Sather (Pipedream) : At a glance it looks like you’re using the template literal syntax and the ${} correctly. Two things I’d suggest:

console.log the value of whatever variable you’re including there to make sure it holds the value you expect it to
• If it does have the right value, take a look at this guide for troubleshooting 400 errors

Tim Kracht : Hey Dylan thanks again for your assistance I did get it to work finaly, I was able to have a work flow create a DM channel on Discord then setup another step to use the return channel ID to then send a message.