This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
In this second article, we’ll see how to let the user select both a file and a field within this file to create the values in the List Box. The file that the user selects doesn’t need to have the same columns as the one you used when building the App.
Show the selection options from one of the columns of a user-selected input file and field
In this example we will use the techniques we’ve explained in the first article including, reading field names from input, creating value list and using chained Analytic Apps to show the second screen with the list of values for selection. Again, make sure you save these workflows as Analytical Apps.
The first workflow uses what was done in the previous article but relies on the fact that Alteryx yxwz files are XML files containing the configurations of the tools of the workflow. To load the user-selected values into the second List Box, we will manually update the XML of the second workflow to change the List Box configuration. The List Box tool, when set to Manually set values, expects a Name:Value pair and therefore we are using the Multi-Field Formula tool to create these pairs and change the field size to make sure it fits the extended text. We then use the Summarize tool to concatenate all of the separate values into a single field with new-line (\n) as separator.
Now that we have our List Box Values ready it’s time to load them into the second workflow. For this to work, we should have already built the second workflow, ProcessWorkflow.yxwz and setup the List Box tool List Values to Manually set values with the value set to _xxxx_:xxxx.
Back to our first workflow, we start by reading in the second workflow we just created. To be able to read it into Alteryx, we set the Input Data tool to read the file as CSV with \0 as the delimiter (no delimiter) and with first row contains field names.
We then use the Summarize tool to concatenate the rows into a single row and make sure you name the field <?xml version="1.0"?> (this will be the first line in our output file).
We bring in the list of values we created in the first part of the workflow and append it to this data stream using the Append Fields tool and then use the formula tool to find the _xxxx_:xxxx text and replace with the correct values. We deselect all fields except the <?xml version="1.0"?> using the Select tool and write the output to a new file ProcessWorkflow2.yxwz using csv as format and \0 as delimiter.
The last step in this workflow is to set the new workflow we just wrote-out to start when the first one finishes execution. This is done by naming the second workflow in the Interface Designer (Alt-Ctrl-d) under Properties: "On Success – Run Another Analytic App". Also the "On Success - Show Results to User" should be deselected.
You can find the workflow used in the article attached to this post. It was built in Alteryx Designer 10.6 (10.6.6.17413).
Special thanks to @patrick_digan for testing and suggesting improvement to the example workflow.