Absent Member.. DavidCole Absent Member..
Absent Member..
318 views

Generate a variable and use for creating a directory

This might be really basic, but reading through the Authoring Guide I can't see it.

 

I want to create a dynamic directory (in windows) based on ticks. 

 

I've created a flow, that uses the FS Create Directory step, and as part of the flow have a scriptlet that gets date.GetTime()

 

The scriplet template has a bunch of returns, myData, scriptletContent.putGlobal, scriptletContext.put.

 

But what I'm really having a problem with, is what do I put in the FS Create Directory as the input? ${myData} doesn't work, the name in the PutGlobal or Put also doesn't work.

 

 

Labels (1)
0 Likes
4 Replies
Absent Member.. AlexGg Absent Member..
Absent Member..

Re: Generate a variable and use for creating a directory

what version of OO do you use? in my FS Create Directory there are 3 inputs: path, user, password. Just path is mandatory.
0 Likes
Absent Member.. DavidCole Absent Member..
Absent Member..

Re: Generate a variable and use for creating a directory

Version 9

 

So does my Fs Create Directory.  Not sure what you're getting at.

 

So in the "path" input to FS Create directory, I want C:\BaseDirectory\yyyy-mm-dd-hh-mm-ss so that it's dynamically created each time the flow is run.

 

0 Likes
Daniel_Linsley Absent Member.
Absent Member.

Re: Generate a variable and use for creating a directory

You can use the ${myData} structure in a constant but not a scriptlet.

 

So if you can get the current yyy-mm-dd-hh-mm-ss in a flow variable called "currentTime", you can set the path input of FS Create Directory to be: C:\BaseDirectory\${currentTime}

0 Likes
Absent Member.. DavidCole Absent Member..
Absent Member..

Re: Generate a variable and use for creating a directory


@Daniel_Linsley wrote:

You can use the ${myData} structure in a constant but not a scriptlet.

 

So if you can get the current yyy-mm-dd-hh-mm-ss in a flow variable called "currentTime", you can set the path input of FS Create Directory to be: C:\BaseDirectory\${currentTime}


Thanks. in all the manuals etc I'd read, this particular aspect (" C:\BaseDirectory\${currentTime}" mixing literals with variables) was not conveyed very well.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.