This topic was automatically generated from Slack. You can find the original thread here.
Hey! I’m beginner to Pipedream, need your help in setting up the trigger where my data from excel sheet can be called daily but only 15 rows in a single day.
This topic was automatically generated from Slack. You can find the original thread here.
Hey! I’m beginner to Pipedream, need your help in setting up the trigger where my data from excel sheet can be called daily but only 15 rows in a single day.
Hi, I think your question is a great case for Pipedream bot to help. I’ll pass your question to the Pipedream bot now. Please feel free to ask it any question
Hey! I’m beginner to Pipedream, need your help in setting up the trigger where my data from excel sheet can be called daily but only 15 rows in a single day.
To set up a trigger that processes data from an Excel sheet daily and only handles 15 rows each day, you can use the Pipedream Scheduler to trigger your workflow once a day and then write custom code to process the 15 rows from your Excel sheet. Here’s a step-by-step guide: 1. Create a new workflow in Pipedream. 2. Add a Scheduler trigger to run your workflow once a day. 3. Add a Node.js code step to read and process the Excel file. Since you’re a beginner, I’ll provide you with a basic structure of the Node.js code step that you might use to read from an Excel file and process 15 rows. Please note that you will need to store the index of the last processed row to know where to start the next day. You can use Pipedream’s built-in data store for this. Here’s an example of how you might structure your code: import { axios } from "@pipedream/platform"; export default defineComponent({ props: { data: { type: "data_store" }, }, async run({ steps, $ }) { // Retrieve the index of the last processed row, or start at 0 if it's the first run let lastRowIndex = (await this.data.get("lastRowIndex")) || 0; const numberOfRowsToProcess = 15; // Code to read your Excel file and extract data goes here // For example, you might use an API to read the Excel file from a service like Google Sheets // You would process rows from `lastRowIndex` to `lastRowIndex + numberOfRowsToProcess` // After processing, update the index of the last processed row lastRowIndex += numberOfRowsToProcess; await this.data.set("lastRowIndex", lastRowIndex); // Return some result or export data if needed }, });
Please replace the placeholder comments with the actual logic for reading and processing your Excel file. If your Excel file is hosted on a service that Pipedream integrates with (like Google Sheets), you can use the pre-built actions to read the data. If you’re using a local Excel file, you’ll need to upload it to a service that can be accessed via API. Remember to handle the case where the Excel file has fewer than 15 rows left to process. You might need to reset the lastRowIndex
to 0 after