This topic was automatically generated from Slack. You can find the original thread here.
hello Guys, how are you doing?
[4:20 PM] I need some help if possible, i’m using Pipedream and would like to use a dynamic row number
[4:20 PM] when i modify a row to get the let’s sat column T(row-number)
I’m using an automation, the trigger is Google sheets ( New Updates (Instant) from Google Sheets. I would like to retrieve the cells data that changed in a dynamic way let’s say T(rowNumber). any help would be appreciate it as i’m sure other users are having the same issue
To retrieve the cell data that changed in a dynamic way, you can use the event property from the Google Sheets trigger step in your Pipedream workflow. The event property contains the updated row data, including the row number. Here’s an example of how to access the updated cell data in column T: export default defineComponent({ async run({ steps }) { const rowNumber = steps.trigger.event.rowNumber; const updatedCellValue = steps.trigger.event.cells['T']; console.log(`Updated cell value in column T and row ${rowNumber}:`, updatedCellValue); }, }); This code will log the updated cell value in column T and the row number. You can replace the console.log statement with any action or code step you’d like to perform with the updated cell value.
To retrieve the value of steps.trigger.event.currentValues.values[1][7] in a dynamic way, you can use variables to represent the indices. For example, you can define rowIndex and columnIndex variables and use them to access the value: export default defineComponent({ async run({ steps }) { const rowIndex = 1; const columnIndex = 7; const dynamicValue = steps.trigger.event.currentValues.values[rowIndex][columnIndex]; console.log('Dynamic value:', dynamicValue); }, }); Replace the values of rowIndex and columnIndex with the desired indices to access the value dynamically.
To retrieve the data of the 7th column of the row that has been changed and triggered, you can use the event property from the Google Sheets trigger step in your Pipedream workflow. Here’s an example of how to access the updated cell data in the 7th column: export default defineComponent({ async run({ steps }) { const rowNumber = steps.trigger.event.rowNumber; const updatedRowData = steps.trigger.event.values; const columnData = updatedRowData[6]; // 7th column has index 6 console.log(`Updated cell value in the 7th column and row ${rowNumber}:`, columnData); }, }); This code will log the updated cell value in the 7th column and the row number. You can replace the console.log statement with any action or code step you’d like to perform with the updated cell value.
I apologize for the confusion earlier. It seems there was an issue with the code I provided. Let’s try another approach to retrieve the data of the 7th column of the row that has been changed and triggered: export default defineComponent({ async run({ steps }) { const rowNumber = steps.trigger.event.rowNumber; const updatedRowData = steps.trigger.event.values; if (updatedRowData && updatedRowData.length > 6) { const columnData = updatedRowData[6]; // 7th column has index 6 console.log(`Updated cell value in the 7th column and row ${rowNumber}:`, columnData); } else { console.log('The updated row data does not have a 7th column.'); } }, }); This code checks if updatedRowData is defined and has more than 6 elements before accessing the 7th column data. If the 7th column data is not available, it will log a message indicating that the updated row data does not have a 7th column.
No, you don’t need any additional extensions for the Google Sheets integration in Pipedream. Pipedream provides built-in triggers and actions for Google Sheets, which you can use directly in your workflows without any extra setup. Just search for “Google Sheets” in the Pipedream UI when adding a new trigger or action step.
I’m sorry to hear that your trigger is not working as expected. To help you better, I need more information about the Google Sheets trigger you’re using and your workflow setup. Can you please provide more details about the trigger configuration and any specific conditions you’ve set for it to trigger? This will help me understand the issue and provide a solution.