Alteryx Designer Desktop Discussions

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

Dynamically changing file path in custom macro to upload to hdfs

JonnyR
7 - Meteor

I'm trying to create a macro which users can use to upload a file to a directory in our hdfs using an output tool but I'm having a few problems. 


1) File format: I want the user to be able to choose between 2 file formats, csv or avro. I know how to have this as an option in the macro config using a dropdown interface tool but I don't know how to feedback this fully into the output tool. A single selection of csv or avro should update 3 parts of the tool; the file type, the file format number and the file format name (see below). How can I do this? 

csv52hdfsc
avro53hdfsa

 

2) Dynamic file path: I'm currently using a dropdown for folder, a dropdown for subfolder and then a text box for file name. These then replace the folder, subfolder and filepath using an action tool each. This works but isn't ideal as the filepath may not match this format. If there's another subfolder or 1 fewer then my macro doesn't account for this. Also, currently selecting a folder won't filter down the subfolder list so a user may end up selecting an area which doesn't exist. Is there a way of doing this more dynamically?

Thanks for your help!

5 REPLIES 5
CharlieS
17 - Castor
17 - Castor

1) Use 3 Action tools to update each of the 3 items on the Output tool. It is possible to do with one Action tool, but you would have to edit the XML of the entire Output tool with a big formula. 

 

2) Is there a reason why a Folder Browse tool wouldn't work? Use that to select the destination folder, then a Text Box to input the file name.

JonnyR
7 - Meteor

1) How do I update it to a value which isn't being input by the macro? i.e. if they input csv, how do I get my action tool to change the value to 52?

 

2) I wanted to use this initially but I don't know how to configure it. The folder structure is coming from a csv but I can't figure out how to input this into the folder browse tool. It doesn't seem to have any input parameters at all. As far as I can see the folder browse tool only looks on the local machine rather than at remote locations which is where the hdfs is stored. 

Thanks for your help!

CharlieS
17 - Castor
17 - Castor

1) I've attached a workflow for the file type specification process and I understand it. 

 

2) With varying amount of subfolders on a network location, it may be best for the user to specify the entire folder path in one text box. that was they input "\\NetworkDrive\Folder1\Folder2\Folder3\File".

JonnyR
7 - Meteor

Hi Charlie,

 

I can't import that workflow as I'm on an older version of Alteryx (11.7). The solution I currently have is to use the update value with formula part of the action tool, which works fine for my use case, but doesn't seem very scalable when there are more than a handful of options. Does your workflow do something different?

 

Thanks!

CharlieS
17 - Castor
17 - Castor

If you need to open a workflow built in a newer version, in most cases, you can just edit the workflow in Notepad (or another text editor) and change the version number to your version.

 

- Right click the .yxmd/.yxmc/.yxwz file > Open with... > Notepad

- Change the version on the second line to your current version (I believe 11.7 is 11.5 in XML)

- Save the file.

 

XMLVersionEdit.png

 

 

Labels