Why Am I Getting an Error While Creating a "bigquery_insert_rows" Action?

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

Hello
While creating a “bigquery_insert_rows” action, I continuously keep getting error

Configuration error
Make sure the custom expression contains a valid object

I am simply selecting the field, available from the list.
Any ideas why?

I believe the issue might be that Rows is expecting an object, but steps.trigger.event.title is a scalar string value.

You can use the handlebars to evaluate an object instead of just a string:

{{ { title: steps.trigger.event.title } }}

let me try

it did work, thanks a lot :fire:

Sure thing, to a video explanation of this concept, watch this:

I get another error now:

SyntaxError
Unexpected token '.'
DETAILS
SyntaxError: Unexpected token '.'
    at _pd_deep_evaluate (/var/task/params_evaluator.js:57:36)
    at _pd_deep_evaluate (/var/task/params_evaluator.js:38:7)
    at MessagePort.<anonymous> (/var/task/params_evaluator.js:11:9)
    at MessagePort.[nodejs.internal.kHybridDispatch] (internal/event_target.js:399:24)
    at MessagePort.exports.emitMessage (internal/per_context/messageport.js:18:26)

I set up my row values as following

The error message you shared (Unexpected token) indicates that you have a syntax error in your code - which is just a fancy way of saying that your code isn’t valid. A comma could be missing, or a colon, or a missing open or close parentheses somewhere.

I get this error

  {
    "errors": [
      {
        "message": "Invalid datetime string \"2023-01-10T15:55:57.000Z\"",
        "reason": "invalid"
      }
    ],
    "row": {
      "pub_date": "2023-01-10T15:55:57.000Z"
    }
  }

In my BigQuery DB I set the column as DATETIME format, it has values as 2023-01-07T20:24:27
Can you clarify how to fix this issue? Do I need to write a specific code to convert the existing in source datetime string into needed format?

You’ll need to consult the BigQuery documentation and compare it against what you’re passing via the action.

Date manipulation or formatting may be required.

You can use Python or Node.js code steps to make this operation before sending the data to BigQuery.

This video shows how to use NPM packages to format timestamps in a Node.js code step in Pipedream: Use NPM packages in code steps - YouTube