how to assign a environment variable to variable

How to assign a environment variable to variable and concatenate a string value to it.

{%- set foo= {{env_var(‘DBT_whatever’)}} ~ “_suffix” -%}

The above syntax doesn’t work.

{% set foo = env_var('DBT_whatever') ~ "_suffix" %}

https://docs.getdbt.com/docs/building-a-dbt-project/dont-nest-your-curlies

Note: @Owen originally posted this reply in Slack. It might not have transferred perfectly.

  database_source: "{{ env_var('DBT_Source') }}"```

<sub>Note: `@Owen` originally [posted this reply in Slack](https://getdbt.slack.com/archives/CBSQTAPLG/p1681387071972099?thread_ts=1681329662.989579&cid=CBSQTAPLG). It might not have transferred perfectly.</sub>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.