How to Insert All Rows from Google Sheet to Postgres DB Using Pipedream?

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

Hi Team I am moving data from google sheet has a lot of rows to postgres DB, however the insert row functionality in Pipedream seems to be just inserting first row and ignoring the others, do i need to add control flow or is there a way, I can insert all of them,

You should file a feature request for a Insert (multiple) Rows action for PostgreSQL.
Could you do us a favor and report this issue in our public repo?

  1. Head over to Support - Pipedream
  2. Click on the “Request an Integration” card.
  3. Select “B - Request changes to an existing integration.”
  4. Fill out the form with details of the issue.
    This way, it gets logged in our public repo, and the component development team can be notified!

Or you can use the Execute SQL Query and build your own query to insert multiple rows

so there is no way I can insert multiple rows from google sheets unless a feature is added

An alternative is to mimic looping by using two workflows: one for getting all the rows from your Google Sheet, and another one to insert each row

In your first workflow, use a custom code step to loop over your Google Sheet rows and invoke the second workflow. Something like this:

for (const row of rows) {
  await $.flow.trigger("p_secondWorkflowID", { row })
}

(or use Promise.all to run all in parallel)

In the second workflow, you’ll get a triggered event and your row data will be available in steps.trigger.event.row

Then you can run that Postgres action

okay let me try and see

Cool, let me know which option do you prefer!

Btw, I just published a helper action for this here: Trigger Workflow For Each - Pipedream

Let me know if it helps