Page 1 of 1

Output folder name

Posted: Tue Jan 19, 2021 8:37 pm
by Whirlpool_Prepress
I know this is very basic but I for whatever reason can not seem to get my head around the hierarchy setting process.

What I am trying to accomplish is the following:

Input folder containing PDFs > flow creates GIF/PNG/JPG > Archive to a folder that is named the original input folder name with sub folders for each file type. Can anyone help a noob out with this?

Re: Output folder name

Posted: Tue Jan 19, 2021 9:11 pm
by baldifabrizio
I'm not an expert, but I built a flow with similar needs to yours. I am attaching some screenshots. the element to use is "Set hierachy path". As you will see, it allows you to extract the various parts of the file path, to recombine them as you need. When you select the element in properties you set Action (there are various, i set "Replace") and set the value of path segment with "Single line text with variables defined".

Re: Output folder name

Posted: Tue Jan 19, 2021 9:11 pm
by baldifabrizio
I'm not an expert, but I built a flow with similar needs to yours. I am attaching some screenshots. the element to use is "Set hierachy path". As you will see, it allows you to extract the various parts of the file path, to recombine them as you need. When you select the element in properties you set Action (there are various, i set "Replace") and set the value of path segment with "Single line text with variables defined".

Re: Output folder name

Posted: Tue Jan 19, 2021 9:33 pm
by Whirlpool_Prepress
Thank you so much for jumping in and trying to help me out!!

So I thought I was on the right track and had tried what you said, but this is where I am running into a wall.

I setup a Set Hierarchy Path element with the following path segments

Path Segment 1 - This is creating the folder name as I expected it to (D200303XM- the name of the input folder)
Screen Shot 2021-01-19 at 3.25.30 PM.png
Screen Shot 2021-01-19 at 3.25.30 PM.png (100.55 KiB) Viewed 5669 times
Path Segment 2 - I thought this would create the next sub folder based on the element name
Screen Shot 2021-01-19 at 3.25.59 PM.png
Screen Shot 2021-01-19 at 3.25.59 PM.png (77.98 KiB) Viewed 5669 times
What is happening is it is creating the folder "D200303XM" and then just placing the gif images in that loose rather than creating the subfolder "GIF" first... what am I missing??

Re: Output folder name

Posted: Tue Jan 19, 2021 11:37 pm
by patej
Hi,
For the Path Segment 2 you need [Job.Extension] (or [Job.Extension:Case="upper"] if you want to ensure uppercase names GIF/PNG/JPG).
[Switch.ElementName] gives you the name of the current flow element, e.g. "Set Hierarchy Path" or "Folder 123".

Re: Output folder name

Posted: Wed Jan 20, 2021 8:50 am
by freddyp
The way to approach hierarchies is by starting at the end: when a job hits "Archive hierarchy" this element creates a folder and subfolder structure based on what is in the [Job.Hierarchy] variable. The same is true by the way for "FTP send".

It is your job as a flow designer to make sure this variable contains the correct value(s) by the time the job arrives at such an element that uses it. There are four ways in which you can manipulate the Hierarchy variable:
  • There are input elements that allow you to add something to the hierarchy: Submit hierarchy, FTP receive, Mail receive and a few others. They also allow you to already select a portion of what could become the hierarchy: that is done by choosing the levels. If you only want the top folder of the input hierarchy you specify that you only want 1 level. You want them all? Specify 99 (or 42 of course)
  • On every intermediate folder there is an "Attach hierarchy info" property. This adds the name of the folder to the hierarchy. This is useful if you want the hierarchy to be different depending on the path the job followed (OK, Error, ...).
  • You can add values to the hierarchy with the "Set hierarchy path" element. This one also allows a number of other manipulations on the hierarchy. This element is useful for adding things to the hierarchy that are not derived from folders, e.g. today's date, something from metadata, ...
  • Through a script (legacy only for the moment)
Of course, the order of the components of the hierarchy is important because that decides the order of creation of the folders. That is why you have the "Add at the top - Yes/No" on folders and why "Set hierarchy path" allows you to massage the values in the variable.