Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.

How to read a file in the same relative location on different Alteryx Servers

VictorLecato
7 - Meteor

We have 2 alteryx servers (TEST and PROD).  We want to create a "config" file on each server (with the same name) in the same relative location.

We would have information specific to the TEST server in the file on the TEST server and different information on the PROD server.

 

We want to do this so we don't have manually change the information in workflows when we move them from TEST to PROD.

 

So far I have not found a way to do this.  I tried using Workflow Dependancies but as soon as you save a workflow to a server the path to the "config" file is changed and a copy is saved as an external file.

 

Anyone have any ideas on how this could be done?

7 REPLIES 7
MarqueeCrew
20 - Arcturus
20 - Arcturus

I was wondering if there is a windows environment variable that you could check so that you could construct logic around it.

 

GetEnvironmentVariable("USERNAME")

Depending upon the variable and result, you could know where to go or what to do based upon the knowledge of knowing where you are running.

 

I have used constants for this in the past.  The XML could be modified based upon the constant. (e.g. path)

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
VictorLecato
7 - Meteor

Tried the Environmental Variable option and it works good for a normal work flow.  However, what I am trying to to is populate a drop down prompt with values based on the app running on the DEV server or the PROD server.

 

Once I add the Drop Down tool after reading the values from a file based on the Env Variable it does not work.  If I set my env variable and run the workflow by clicking the green run button the values in the drop down values are updated based on the Env Variable.  If I close the Alteryx Designer, change the Env Variable, open designer and just run it as an App the drop down uses the previous values and not the values associated with the updated Env variable.

 

I've attached a test work flow for this.  You will need to create an Env Var and the files it should read to populate the drop down.

 

Thanks for any help.

MarqueeCrew
20 - Arcturus
20 - Arcturus

If you are available now for a WebEx, I will clarify the concept of the application and action needs.

 

https://meetings.webex.com/collabs/meetings/join?uuid=MAVM71BOH8HNTTKMJDQQYVUS5Q-UCSL&epwd=bfc7d82da...

 

I've opened a conference and you may join it now.

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
VictorLecato
7 - Meteor

Sorry - I was in a meeting and missed you reply.  I am available for the next hour if you are still willing.

 

KaneG
Alteryx Alumni (Retired)

Hi @VictorLecato,

 

You can do this by using an absolute path. For instance "D:\Configs\config.txt". You wont be able to use relative paths, as the Alteryx Server will run the app in a temp workspace. When you publish to the Gallery, make sure that you don't upload the config file with it.

VictorLecato
7 - Meteor

Stupid Question:  How do I make sure the config file is not uploaded? 

 

If I can get this to work, I think it'll solve my issue.

KaneG
Alteryx Alumni (Retired)

I probably should have mentioned that... On the save screen, click Manage Workflow Assets and deselect the file.

 

Manage_Workflow_Assets_v1.png