This topic was automatically generated from Slack. You can find the original thread here.
Grady Sain : I’m trying to pass a url from one step ----- data: { Name: string; }; ----- into the next step. I’m using 's article on medium on how to web scrape. I’m trying to replace the http://example.com url with a dynamically generated url from the step before… I pasted console.log(steps.trigger.event); into the node.js step and I can’t figure out how to make this line work… trying variations on ----- const $ = await fetchHTML( steps.nodejs.data )
Dylan Sather (Pipedream) : Take a look at this example.
In steps.URL, I run:
this.myURL = "https://example.com"
This creates a “step export” called myURL that can be referenced in future steps using the variable steps.url.myURL.
In the reference_step_variable_directly step, I reference that variable directly:
console.log(steps.url.myURL)
You can also create a step param that allows your step to accept input (this is how all of our actions work, where you see a form with inputs for each property) by adding params.url to your step. In your case you’ll want something like:
const $ = await fetchHTML(params.url)
Then in the URL form that appears above the step, you can pass the URL from the previous step like so:
Grady Sain : thanks for your help- I got it working. But now my problem is that the data isn’t formatted correctly (error 422) for Airtable, which is where the scraped page is going to reside… I’ll work on it and let u know if I get it working. Thanks again for your help, and FYI I am loving PipeDream!
Dylan Sather (Pipedream) : That’s a good hypothesis, I’m not sure. Would you mind clicking the Share button at the top-right of your workflow and share it with dylan@pipedream.com?