Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

XML read Input Data from .yxmd file

jcardoso
8 - Asteroid

Hi,

i have multiple worklflows in some folder, and each one of them, contain always, an Input Data tool, unique, per workflow.

 

I want to make a workflow to get the data of the Input Tool for all the workflows in the folder, dynamically, into a table, without having to open the workflows and merge the Input Data for each one of the workflows .

The idea is to, as soon as a new workflow is added, the list gets updated, when running it again.

I've tried with a macro for each xml file path, but without success. Help is much appreciated.

For example, the XML looks like the below, how to extract Data into columns, for all the workflows:

<Configuration>
<NumRows value="1" />
<Fields>
<Field name="Col1" />
<Field name="Col2" />
<Field name="Col3" />
<Field name="Col4" />
</Fields>
<Data>
<r>
<c>abc</c>
<c>1</c>
<c>1234</c>
<c>x</c>
</r>
</Data>
</Configuration>

Regards,

8 REPLIES 8
BenMoss
ACE Emeritus
ACE Emeritus

Are we over complicating this, are the files for the input data tools always stored in the same location? If so you could simply use an a file directory and dynamic input to bring them all in.

 

If you wish to go down the path you have highlighted I would create a batch macro (one yxmd per batch). 

 

You would read the .yxmd file as an undelimited .csv file (\0) and then parse the data to only the line which contains the path to the input file.

 

You can then use a dynamic input to read the file into alteryx and pass the output out of the macro. Does this make sense? 

 

Ben

BenMoss
ACE Emeritus
ACE Emeritus

I've just seen it looks like your using a 'text input' tool judging by what your XML looks like?

 

Ben

BenMoss
ACE Emeritus
ACE Emeritus

Here is a solution for converting a text input table into a data table within Alteryx.

 

Note you will simply have to change the folder in the input data tool to point at the directory you wish to view (leave the *.yxmd as this is the wilcard to bring in all .yxmd files in that location).

 

When you do this you will get a prompt, choose \0 as your and make sure you uncheck the option 'first row contains field names'.

 

Ben

jcardoso
8 - Asteroid

Hi Ben,

can't thank you enough for this!

I've managed to work out your workflow, as what actually controls the Text Input is the AlteryxBasePluginsGui.TextInput.TextInput tag, and not tool id, as previously thought.

Changed few other bits, but the essential is there, attached.

Best Regards,


brindhan
9 - Comet

Hi @BenMoss 

Thanks for this.

One issue I face is the fact that sometimes the field gets truncated and I end up losing my tablename.

Eg Im looking to find table sales. While reading the file in, it gets truncated so I get 2 lines- 'sa' and 'les'

So when i parse for 'sales', I dont get a match.

 

Am I doing something wrong? Im reading through directory and dynamic input as a non delimited csv.

 

Thanks!

 

bbartlett
6 - Meteoroid

I've also been looking into this to create a table of dependencies for all of our workflows.

It seems simple enough to scan through and grab table/file names however I wanted to take it a step further and query the XML objects so that I could capture the tool number/Annotation, connection type as well as the query behind it.

 

I'm thinking this should be simple enough via XQuery and am exploring it within Python.

Once I manage this for files I also wanted to attempt it for workflows in the Gallery.  I've played with the Alteryx Server Usage Report a bit but does anyone know if we can pull the XML for workflows from the MongoDB?

mtornga
6 - Meteoroid

@bbartlett I'm on the same path as I look to see how I can streamline migrations from small galleries to the main enterprise gallery. 

 

Attached is a workflow for pulling workflows from MongoDB and then here is a link to a thread about pulling workflows through the gallery API: https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Retrieving-workflow-xml-from-Gallery/t...

Or a link to my own workflow downloading utility: https://community.alteryx.com/t5/Alteryx-Server-Discussions/ServerRipper-Using-the-Alteryx-Gallery-A...

 

If you came up with any solutions for pulling and organizing the dependencies, I'd love to hear about it. Otherwise, I will trudge along on my own!

michaelhimmel
6 - Meteoroid

@mtornga Did you make any headway on this?  I'm trudging along the same path and am hopeful you found success!

Labels