Issue with Dataform Variable 'undefined' During Single SQLX Execution

Hi everyone,

I’m back here seeking some help!

I’ve created my Dataform in BigQuery, which is supposed to be called by a DAG. Inside it, I have a WHERE condition: WHERE codice = ‘${dataform.projectConfig.vars.Codice}’.

From what I understand, this variable can be changed by the DAG when it calls the Dataform.

Now, here’s my question: I’ve set up my dataform.json file with the following content:

JSON

{
  "vars": {
    "codice": "active"
  }
}

However, when I perform a start execution by launching the single SQLX, the value I get is ‘undefined’:

SQL

WHERE codice = 'undefined'

Why is this happening? What am I doing wrong?

Thanks in advance for any help!

Great! I solved it out myself this time :slightly_smiling_face:

The dataform.json file needs to be outside the include folder.

Thanks!