# Passing template variable value using python-sdk

**URL:** <https://community.transloadit.com/t/passing-template-variable-value-using-python-sdk/15428>\
**Category:** Transloadit\
**Created:** [September 1, 2020, 8:09pm UTC](https://community.transloadit.com/t/passing-template-variable-value-using-python-sdk/15428 "2020-09-01T20:09:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Javedgouri](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/javedgouri/32/328_2.png) [@Javedgouri](https://community.transloadit.com/u/Javedgouri)\
**Post date:** [September 1, 2020, 8:09pm UTC](https://community.transloadit.com/t/passing-template-variable-value-using-python-sdk/15428/1 "2020-09-01T20:09:41Z")

</div>

Hi,  
how i pass a variable value of template using python-sdk

---

<div class="post-metadata">

**Author:** ![Ethan](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/ethan/32/254_2.png) [@Ethan](https://community.transloadit.com/u/Ethan)\
**Post date:** [September 1, 2020, 8:25pm UTC](https://community.transloadit.com/t/passing-template-variable-value-using-python-sdk/15428/2 "2020-09-01T20:25:13Z")

</div>

Hey,

So if your Template looks like this, where you use a variable named “my\_variable”.

```json
{
  "steps": {
    "files_import": {
      "robot": "/http/import",
      "url": "${fields.my_variable}"
    }
  }
}

```

Then your Python code will look like the following to set the variable. You pass in a dictionary that represents the params field used by the Transloadit API. This dictionary contains a key for fields to allow for passing of custom variables. The documentation related to this is [here](https://transloadit.readthedocs.io/en/latest/transloadit.html#module-transloadit.assembly) for the Python SDK and as documented [here](https://transloadit.com/docs/api/#resource-assemblies) under “Supported keys inside the params field”

```python
from transloadit import client

tl = client.Transloadit('TRANSLOADIT_KEY', 'TRANSLOADIT_SECRET')
assembly_options = {
  "fields": {
     "my_variable": "https://transloadit.edgly.net/assets/images/home/robots.png"
   }
}
assembly = tl.new_assembly(options=assembly_options)
assembly_response = assembly.create(retries=5, wait=True)

print assembly_response.data.get('assembly_id')

```
