title: Airflow | Set Variable
body: <p>Does anyone know the syntax to update a variable from a DAG in Airflow, but in JSON format?</p>
  <p>Right now I have this:</p>
  <p><code>Variable.set(f&quot;update_{kwargs['table_id']}&quot;, *last_update)</code></p>
  <p>This updates the  variable  to this:</p>
  <ul>
  <li><code>updated_giftcard_id  0</code></li>
  <li><code>updated_order_id    0</code></li>
  </ul>
  <p>But this creates new variables which is not scalable.</p>
  <p>Ideally, I would like to update the same variable and pass them in  JSON format:</p>
  <p>EG: <code>&quot;last_ids&quot;: {&quot;updated_giftcard_id:&quot; &quot;0&quot;, &quot;updated_order_id:&quot; &quot;1&quot;, etc}&quot;</code></p>
  <p>I tried passing some params like <code>Variable.set(key=&quot;updated_giftcard_id&quot;, value=&quot;0&quot;, serialize=True)</code>, but was not working properly since it was complaining that I was passing too many params.</p>
  <p>Thanks in advance!</p>