# Flow Variables - Usage - Excel Writer - Filename

**URL:** <https://forum.knime.com/t/flow-variables-usage-excel-writer-filename/31935>\
**Category:** KNIME Analytics Platform\
**Created:** [April 3, 2021, 6:05pm UTC](https://forum.knime.com/t/flow-variables-usage-excel-writer-filename/31935 "2021-04-03T18:05:43Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![alfkah](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/a/43a26b/32.png) [@alfkah](https://forum.knime.com/u/alfkah)\
**Post date:** [April 3, 2021, 6:05pm UTC](https://forum.knime.com/t/flow-variables-usage-excel-writer-filename/31935/1 "2021-04-03T18:05:43Z")

</div>

Hi,  
as a beginner/newbie I have a question about using flow variables.

I have created two flow variables. One of them is usable at the Row Filter node, as expected.

The second flow variable (the filename of the output file) is not offered when configuring the filename of the XLSX file.

Since I want to write multiple spreadsheets (sheets) to one XLSX file in this workflow, controlling the filename via a flow variable would be a great time saver.

Thanks for your support.

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/5/b/5b41a949efe051b31f70db8e762e7a699607068a.png)

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/3/a/3a6ef8425fd39aa02598b3b2de365202c7f5006c.png)

---

<div class="post-metadata">

**Author:** ![takbb](https://forum-cdn.knime.com/user_avatar/forum.knime.com/takbb/32/57077_2.png) [@takbb](https://forum.knime.com/u/takbb)\
**Post date:** [April 3, 2021, 6:37pm UTC](https://forum.knime.com/t/flow-variables-usage-excel-writer-filename/31935/2 "2021-04-03T18:37:35Z")

</div>

Hi @alfkah,

I found the following post which may be of assistance. Take a look at this and see if the explanations given there help you.

> [@Unable to use flow variables in e.g. Excel Writer](https://forum.knime.com/t/unable-to-use-flow-variables-in-e-g-excel-writer/30605):
>
> Hi, I’m relatively new to Knime – I’ve reached the point where I want to create workflows which automatically populate filenames with the current date and so on. My understanding is that this is done in knime using flow variables, but nothing i have done works. In presentation, my problem appears to be that when i click on the variable button to the right of the browse button (when setting the output path and filename for the Excel Writer) the ‘Use Variable’ checkbox appears to be permanently d…

---

<div class="post-metadata">

**Author:** ![takbb](https://forum-cdn.knime.com/user_avatar/forum.knime.com/takbb/32/57077_2.png) [@takbb](https://forum.knime.com/u/takbb)\
**Post date:** [April 3, 2021, 6:55pm UTC](https://forum.knime.com/t/flow-variables-usage-excel-writer-filename/31935/3 "2021-04-03T18:55:06Z")

</div>

In essence, this is an example series of nodes based on the ideas given in that thread:

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/5/b/5b354d336fc3e7104847d4f6bc765b669057434f.png)

---

<div class="post-metadata">

**Author:** ![takbb](https://forum-cdn.knime.com/user_avatar/forum.knime.com/takbb/32/57077_2.png) [@takbb](https://forum.knime.com/u/takbb)\
**Post date:** [April 3, 2021, 7:28pm UTC](https://forum.knime.com/t/flow-variables-usage-excel-writer-filename/31935/4 "2021-04-03T19:28:32Z")

</div>

I’ve put together a similar workflow as an example:

> **[Flow Variable As Output Filename for Excel Writer – takbb](https://hub.knime.com/takbb/spaces/Public/latest/FlowVariableAsOutputFilename)**
>
> Simple demonstration of using a file name in a flow variable as the output file name on Excel Writer. The flow variable must be a "path" type variable, and not…

---

<div class="post-metadata">

**Author:** ![mauuuuu5](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mauuuuu5/32/351_2.png) [@mauuuuu5](https://forum.knime.com/u/mauuuuu5)\
**Post date:** [September 9, 2021, 1:43am UTC](https://forum.knime.com/t/flow-variables-usage-excel-writer-filename/31935/5 "2021-09-09T01:43:31Z")

</div>

Hi @takbb thank you for the workflow, I beg if you can help me. I am trying to write several Excel sheets into a single file, but I am unable to get the proper path.

Let’s say that the file is located into C:\ and the workflow is: C:\Users\User\knime-workspace.

I am uploading a workflow that is slightly modified from yours.

Thank you

[FlowVariableAsOutputFilename Several Sheets.knwf](https://forum.knime.com/uploads/short-url/vsBfeJt9pYWaSKA7UnDlxYlD8zK.knwf) (48.5 KB)

---

<div class="post-metadata">

**Author:** ![bruno29a](https://forum-cdn.knime.com/user_avatar/forum.knime.com/bruno29a/32/28802_2.png) [@bruno29a](https://forum.knime.com/u/bruno29a)\
**Post date:** [September 9, 2021, 2:41am UTC](https://forum.knime.com/t/flow-variables-usage-excel-writer-filename/31935/6 "2021-09-09T02:41:58Z")

</div>

Hi @mauuuuu5 , you can check these threads and their example workflows that may help:

> [@Excel Writer - Variable Sheets](https://forum.knime.com/t/excel-writer-variable-sheets/35656):
>
> I’m trying to create a workflow to write to various sheets in an Excel file, based on a user selection of databases to query. For example, we have 10 database tables that a user might want to query data from. Let’s just call them Info1, Info2, Info3, etc. A user might want Info2, Info4, and Info7 for account 33388. I’d like them to just enter 33388 into a string configuration node, and then check the boxes next to Info2, Info4, and Info7, and it would generate an Excel file with three tabs, nam…

> [@How to write an excel with multiple sheets](https://forum.knime.com/t/how-to-write-an-excel-with-multiple-sheets/33625):
>
> Hi guys, I need a little help with writing an excel file with multiple sheets. I tried using a previous workflow someone had posted but the nodes are now deprecated. I have this table and would like to make a loop that writes an excel file like this: Since there are only two sheets I could do it manually but I have another table that would require 15 sheets. I attach my workflow below. [Help\_excel\_sheets.knar](https://forum.knime.com/uploads/short-url/uKSsybH9Fd5u60v4Z9tEYNmwOAU.knar) (146.0 KB) Would greatly appreciate any help.

---

<div class="post-metadata">

**Author:** ![mauuuuu5](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mauuuuu5/32/351_2.png) [@mauuuuu5](https://forum.knime.com/u/mauuuuu5)\
**Post date:** [September 9, 2021, 2:51pm UTC](https://forum.knime.com/t/flow-variables-usage-excel-writer-filename/31935/7 "2021-09-09T14:51:44Z")

</div>

Hi Bruno thank you I cannot manage to write the excel file into my Desktop, I am attaching you a workflow with an excel deprecated node, just want to know how can I use it with the current excel node.

Thank you

Mau[Excel Writer - Variable Sheets.knwf](https://forum.knime.com/uploads/short-url/kEri7WgS9gRrT6MMtbt1QmnyVL1.knwf) (46.5 KB)

---

<div class="post-metadata">

**Author:** ![bruno29a](https://forum-cdn.knime.com/user_avatar/forum.knime.com/bruno29a/32/28802_2.png) [@bruno29a](https://forum.knime.com/u/bruno29a)\
**Post date:** [September 9, 2021, 8:19pm UTC](https://forum.knime.com/t/flow-variables-usage-excel-writer-filename/31935/8 "2021-09-09T20:19:56Z")

</div>

Hi @mauuuuu5 , I checked the workflow you uploaded, the one you modified from mine, it looks like it ran properly (it’s in green state).

Can you let me know what the issue is? It’s going to be hard to play around with legacy nodes. Any reasons why you want to use Legacy nodes?

Just a comment, you don’t need to link these 2 nodes twice:  
 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/9/f/9f5e46eb065facbdddae5f3a77919e8e093432a2.png)

You can remove the top link.

I also checked your version of @takbb 's node. Your issue there is that your String to Path (Variable) is creating a path Relative to the workflow data area, which is basically the data folder under the Workflow, while you are trying to write to an absolute path “C:\File.xlsx”:

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/b/d/bdae09f706d16d5b04056768c4db492a3d6848e9.png)

You just need to change it to Local File System like this:

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/8/c/8c2e119a447d94379b7342535be3b2c82db77fd8.png)

And it will create the proper path for you.

---

<div class="post-metadata">

**Author:** ![mauuuuu5](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mauuuuu5/32/351_2.png) [@mauuuuu5](https://forum.knime.com/u/mauuuuu5)\
**Post date:** [September 10, 2021, 1:01am UTC](https://forum.knime.com/t/flow-variables-usage-excel-writer-filename/31935/9 "2021-09-10T01:01:50Z")

</div>

Hi @bruno29a thank you for your help, that was the trick. I had to change the node because for no reason the old node shows “Execute Failed: Failed to read zip entry source”

Best regards

---

<div class="post-metadata">

**Author:** ![takbb](https://forum-cdn.knime.com/user_avatar/forum.knime.com/takbb/32/57077_2.png) [@takbb](https://forum.knime.com/u/takbb)\
**Post date:** [September 10, 2021, 9:20am UTC](https://forum.knime.com/t/flow-variables-usage-excel-writer-filename/31935/10 "2021-09-10T09:20:09Z")

</div>

Hi @mauuuuu5 , I’m sorry that I somehow didn’t spot your message but I’m glad you’re sorted, and my thanks to @bruno29a for the (as always) comprehensive assistance and expertise.

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [March 11, 2022, 9:20pm UTC](https://forum.knime.com/t/flow-variables-usage-excel-writer-filename/31935/11 "2022-03-11T21:20:40Z")

</div>

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