Insert rows into bigquery

I’m trying to setup an integration where I want to insert rows into a bigquery table. (google_cloud_bigquery_insert_rows integration)
However, it keeps giving me an error that ‘Rows must be an array’

Testing out a lot of things in the custom expression for rows, but it keeps giving me this error.
tried input:
[{"test":1234,"weight":10}]
but this doesnt work. I then tried stuff like
{"test":1234,"weight":10} (based on the example in the interface)
as well as
["test":1234,"weight":10]

also tried to construct the array using the interface… this all keeps giving me the error.
Seems to me the first input should be the correct one and not sure why it is failing this check within the code:

    if (!Array.isArray(rows)) {
      throw new Error("Rows must be an array");
    }

any suggestions or ideas?

Hi @cvdberge

First off, welcome to the Pipedream community. Happy to have you!

Are you entering in a custom expression in the prop?

You will need to use double brackets to signal to evaluate the expression as Javascript, not as a string.

For example, if you plainly enter in: ['a', 'array', 'of', 'strings'], by default the custom expression will render that as a string:

"['a', 'array', 'of', 'strings']"

Using {{ ... }} will render the expression using Javascript instead:

{{ ['a', 'array', 'of', 'strings'] }}

// evaluates to 

['a', 'array', 'of', 'strings']

Here’s the documentation on how to evaluation JS in props: Using Props

Hope this helps!

ah that makes sense! apologies for my ignorance :wink:

1 Like