Is it possible to insert an environment variable into the JSON string of a bash script curl request POST body?

I am trying to use the bash scripting component to trigger a curl POST request to an external service. Inside of the JSON body string, I want to embed a Matillion environment variable. See example:

 

0694G00000GI5b9QAD_0D54G00007vhYi3SAE

 

Is this the proper way to inject the environment variable?

Hi @Singularity​ ,

Looking at the documentation, the variables work like they do in other components: ${my_variable}.They have an example in the documentation: https://documentation.matillion.com/docs/2407347#example.

Hope this helps.

Glad to hear you got it working!

Thanks @DataGuy​ . I was able to resolve by wrapping the environment variable reference in single quotes to effectively escape it out of the JSON string. When testing, the CURL request was able to interpret this as a single string after first resolving the environment variable reference and injecting the actual variable name. Here is what it looks like.

0694G00000GIAZmQAP_0D74G000007jmExSAI