Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Dynamically creating filename

Vamsee_kris
7 - Meteor

Hi team,

 

I was looking to create a parameter which would take a string value from user and add that to the filename creation. (Dynamic way to do it )

 

Example :- I have Dev,Prod and Test regions and I am trying suffix a string to filename based on the region that I run the flow.

 

filename:- Cust_DEV_TimeStamp.txt or Cust_PRD_Timestamp.txt or Cust_TST_Timestamp.txt

 

Any help appreciated.

 

 

15 REPLIES 15
jdunkerley79
ACE Emeritus
ACE Emeritus

In the output tool there is an option to take the file/table name from a field.

2016-04-15_13-22-24.jpg

 

You can use an Append Fields tool to add a single field value to all rows and then this option would let you append a suffix to the filename.

If you want it in the middle as you showed then you would need to use a formula tool to create the required filename

Vamsee_kris
7 - Meteor

Thanks for your quick reponse .

 

But I want it to be added to the filename it does not come along with data from start . When I follow these approach I have to create 3 different fields and have three stings init like DEV,PRD and TST. at have to choose one everytime getting into flow.

 

AndrewW
11 - Bolide

jdunkerleys suggestion is good. How do you know whether you're in DEV, PRD or TST? Can this be identified in the data? How does Alteryx know in which it is running?

Vamsee_kris
7 - Meteor

that is the reason, I would like see if alteryx accepts any dynamic parameter during the run time. when I pass the parameter that should get assigned to a field and as said I can use that field in output component.

AndrewW
11 - Bolide

There could be ways - for example if the directory you're saving the workflow contains the environment you could parse that value and add it to the file name.

 

You could also drive the workflow from a config file and pass in the variables from a config file - this is how I'm currently working to prevent making changes to the workflow as I move between environments, I just update the config file.

jdunkerley79
ACE Emeritus
ACE Emeritus

You could do this in an  analytic app or have a user constant on the workflow

Vamsee_kris
7 - Meteor

Can you help me with more information on config file changes if possible ?

jdunkerley79
ACE Emeritus
ACE Emeritus

The simplest way would be to have a text file in the same location as the workflow and use an input tool to read it in.

 

You can then take the first row and append the field to the other data flow.

 

Will post a sample in a few minutes

AndrewW
11 - Bolide

Sure, create a simple text file containing the variables you want to load into the workflow. This text file should be an Input into the workflow. Depending on how you move between environments - personally I have a folder structure that's replicated in each enviroment, use the .. (relative references) for my config file Input, meaning when I copy a workflow between environments it automatically points to the config file within the 'new' environment - assuming the config file is in the same relative location in the different environments.

 

When moving between environments I copy the macros and workflows only. My config file is always a fixed Input Data tool with a relative reference - Options - Workflow Dependencies. Other inputs are Dynamic Inputs with the file path of the input taken from the config file.

 

Sorry, not so easy to explain in words. I also can't upload screenshots with the IT settings here (feel free to upvote this and put more pressure on the forum provider to make this happen http://community.alteryx.com/t5/Suggestions-For-Our-Community/Paste-images-directly-into-discussions...

Labels