using the create temp dir node with java edit variable node

I’m trying to create a filename with today’s date as part of the naming convention.

i know how to use the Java Edit Variable to do this but now I want to go from this

image

to incorporating the temp directory node like this

image

Does anyone know how to do this?

Thanks,

Ray

You could check this example out. Please note by default the Temp folder will be deleted after reset. You could also create a permanent folder or de-select the delete option.

4 Likes

Thanks.

I’ll let you know how it works.

Ray

Hi. Oops, @mlauber71 was too fast for me :grinning: Oh well, here’s another (perhaps more specific to your situation) answer. Place your Java Edit Variable node before the Create Temp Dir node.
image
The Java node should create a variable (perhaps named “timestampFilename” with the value equal to the desired file name (e.g. “12162019.csv”). Next configure the Create Temp Dir node with an Additional Path Variable. Give it a name (e.g. “timestampfile” and a value that will be controlled by a workflow variable (the variable created by the Java Edit Variable node in the prev. step). This node will create a new variable with the full path name (temp dir path plus your timestamp file name). (That’s the critical part).
image
image
Finally use the timestampfile workflow variable created in the prev. step to parameterize the CSV Writer.

timestamp file.knwf (10.2 KB)

4 Likes

It worked!

Thanks,

Ray

it works thanks!!

Ray

1 Like

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