Using variables in filepath

Post Reply
User avatar
Terkelsen
Member
Posts: 126
Joined: Thu Sep 08, 2011 5:08 pm
Contact:

Using variables in filepath

Post by Terkelsen »

Would it be possible to use a variable as part of a filepath for a folder in Switch?

I have a fixed folder structure for all costumers. The only difference is, that the top folder would be named after the costumer. All files are submitted through a Submit Point and the name of the costumer (which equals the name of the top folder) is supplied as metadata.

I have a specific flow that will be duplicated for each costumer and at different point in this flow I use folders in that same folder structure. Let's say I have this folder structure: Name/Input/Datasource. Rather than change each flow to point to the correct folder, it would be really handy if I could define "Name" as a variable grabbed from the metadata.

I use variables for paths in "Inject Job", but the same syntax doesn't seem to work for a folder path. Any ideas?
User avatar
gabrielp
Advanced member
Posts: 577
Joined: Fri Aug 08, 2014 4:31 pm
Location: Boston
Contact:

Re: Using variables in filepath

Post by gabrielp »

Sounds like set hierarchy and submit hierarchy would work for you. Within set hierarchy, you can enter variables.
Chat: open-automation @ gitter
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
User avatar
Terkelsen
Member
Posts: 126
Joined: Thu Sep 08, 2011 5:08 pm
Contact:

Re: Using variables in filepath

Post by Terkelsen »

I don't think I understand how that would help? What I want is to be able to set the path to a specific folder in my flow, by using variables.
lombert
Member
Posts: 166
Joined: Fri Feb 04, 2011 2:31 pm
Location: Sweden

Re: Using variables in filepath

Post by lombert »

Terkelsen wrote:Let's say I have this folder structure: Name/Input/Datasource. Rather than change each flow to point to the correct folder, it would be really handy if I could define "Name" as a variable grabbed from the metadata.
But if you set the hierarchy and then point it to the root-folder there you want your unique folder, then you get the correct folder structure there? Or is I missing something? :)
Between jobs!
loicaigon
Member
Posts: 147
Joined: Wed Jul 10, 2013 10:22 am

Re: Using variables in filepath

Post by loicaigon »

Hi,

Defining a Hierarchy seems also a good idea to me because you can have you "all the clients" folder basis and create the "per client" subfolder structure based on the metadata. Once that done, you can have another flow that would use a hierarchy entry point on the "all the clients" folder and retain the hierarchy path so you can dispatch the jobs between the appropriate flows.

Unless I misunderstand the request.

Loïc
User avatar
TheCaptain
Member
Posts: 62
Joined: Mon Jan 18, 2016 4:22 pm
Location: London

Re: Using variables in filepath

Post by TheCaptain »

I'm wondering if he means rather than creating Folders, instead he's looking to direct traffic to specific folders that already exist but are nested within a consistent Folder Structure.

So whether the top level folder is called; Nike / Adidas / Puma, the lower levels are always named the same i.e Proof / Artwork / Data.

In this way he needs a variable to point to the lower level of a unique top level.

If this is the case, I believe hierarchy can still complete this task but you would need to specify Regular Expressions style layer arguments to pinpoint a specific item.

This https://www.cheatography.com/davechild/ ... pressions/ may help...
Post Reply