๐ Using Datasets
Datasets let you run scripts with structured input โ like URLs, usernames, emails, or product IDs. They are useful when you want to repeat a task across many items.
๐ฅ Reading a Datasetโ
Use the read()
function to load a dataset by name:
rows = read("leads")
This returns a list of objects โ each object represents a row in the dataset.
Example:
rows = read("leads")
for row in rows
visit(row.url)
record("url", row.url)
end
Dataset column headers (for CSV) or object keys (for JSON) become accessible as row.field_name
.
The dataset contents are injected into the runtime context, so you can use them like regular variables.
๐งช Example Use Casesโ
- Visit and scrape multiple product pages
- Submit a form for each user in a list
- Log in to several accounts with different credentials
๐ Tipsโ
- Upload datasets via the Datasets tab in CSV or JSON format
- Use
print(row)
to debug or explore the data inside your script - Keep dataset sizes manageable for performance (see Runtime Limits)