# Pass variable as output filename

**URL:** <https://community.automationedge.com/t/pass-variable-as-output-filename/4740>\
**Category:** Process Studio\
**Created:** [September 10, 2021, 2:20am UTC](https://community.automationedge.com/t/pass-variable-as-output-filename/4740 "2021-09-10T02:20:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmr](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@jmr](https://community.automationedge.com/u/jmr)\
**Post date:** [September 10, 2021, 2:20am UTC](https://community.automationedge.com/t/pass-variable-as-output-filename/4740/1 "2021-09-10T02:20:00Z")

</div>

Hi,

How can I set the variable i’ve created on the modified javascript step to make it the output filename?

---

<div class="post-metadata">

**Author:** ![KalyaniW](https://avatars.discourse-cdn.com/v4/letter/k/71e660/32.png) [@KalyaniW](https://community.automationedge.com/u/KalyaniW)\
**Post date:** [September 13, 2021, 6:27am UTC](https://community.automationedge.com/t/pass-variable-as-output-filename/4740/2 "2021-09-13T06:27:50Z")

</div>

Hi @jmr

Can you elaborate your use case?

---

<div class="post-metadata">

**Author:** ![jmr](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@jmr](https://community.automationedge.com/u/jmr)\
**Post date:** [September 13, 2021, 6:31am UTC](https://community.automationedge.com/t/pass-variable-as-output-filename/4740/3 "2021-09-13T06:31:28Z")

</div>

here’s the syntax on the modified javascript step.

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/automationedge/original/1X/b189226bb63b7c176d39df03c729894d5cc6f2bd.png)

what I would like to do is make the “Filepath” as the output filename on the next step which is the excel writer. is this possible?

---

<div class="post-metadata">

**Author:** ![KalyaniW](https://avatars.discourse-cdn.com/v4/letter/k/71e660/32.png) [@KalyaniW](https://community.automationedge.com/u/KalyaniW)\
**Post date:** [September 13, 2021, 6:37am UTC](https://community.automationedge.com/t/pass-variable-as-output-filename/4740/4 "2021-09-13T06:37:10Z")

</div>

Yes it is possible, in the Modified JavaScript step there is a button called Get Variables, you can click on it and all the variables declared in the JavaScript will appear as an output, so select the desired variable and pass it to the next step.  
I’ve attached the screenshot for your reference.

 ![Image](https://canada1.discourse-cdn.com/flex027/uploads/automationedge/original/1X/e7e0f1c9b412058522fa6a1df4d2e8d6e7e60799.png)

---

<div class="post-metadata">

**Author:** ![jmr](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@jmr](https://community.automationedge.com/u/jmr)\
**Post date:** [September 13, 2021, 6:41am UTC](https://community.automationedge.com/t/pass-variable-as-output-filename/4740/5 "2021-09-13T06:41:29Z")

</div>

and then here on the Filename field, what should i write to make it the filename?

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/automationedge/original/1X/0cddf766e0450d09fd65d7d9ad42f12dd5f4bceb.png)

---

<div class="post-metadata">

**Author:** ![KalyaniW](https://avatars.discourse-cdn.com/v4/letter/k/71e660/32.png) [@KalyaniW](https://community.automationedge.com/u/KalyaniW)\
**Post date:** [September 14, 2021, 4:40am UTC](https://community.automationedge.com/t/pass-variable-as-output-filename/4740/6 "2021-09-14T04:40:54Z")

</div>

One of the ways is to use a workflow executor and then create a new workflow and pass those parameters in that workflow.
