This week I am creating my first app. One of the tools I am using is the List Box tool, which allows the user to select several options from a list that you can specify.
This list of options can be created in several ways. The following three are probably the easiest and most commonly used:
- If you insert the List Box tool into your workstream it will automatically switch to use ‘Fields from Connected Tool’ and will take all the field names from your input stream. So you can just take a second output from your main stream and route this to the LBt to include all your fields. You can also choose just to display specific field types. For instance all strings or only bytes. You could also use a Select tool in this routed data stream to choose just those fields that you want to have as selectable values.
- You can type your values in a text input tool if they aren’t yet contained in your workflow and connect this tool in the same way. Again the LBt will automatically take the field names from this text input and populate the list with these.
- You can choose to ‘Manually set values’ and type these out right in the tool configurations or copy and paste them from somewhere else.
What does this actually return? This is a question I struggled with for a while because you cannot simply attach a browse tool to your output and it isn’t clear what format your values are returned in. The answer is that you have two options.
So lets assume this LBt has three choices that I have specified: Sales, Profit, Quantity. The user selects Sales and Profit and runs the app.
- If you ‘Select Tool Mode’ in the configuration this will return each value with a true or false mark. So Sales=True, Profit=True, Quantity=False
- If you ‘Generate Custom List’ this will only return those values that were selected and format these according to your preferences. The default option here would return “Sales”,”Profit”. The configuration in the image is altered so it will give me Sales, Profit. That means I can then just use a Text to Columns to separate those into rows or columns. Note that this option gives you only the values that were selected while tool mode will provide information about each option.
When you connect your LBt to the tool you wish to update an action tool will automatically appear. Here you will need to configure what the values that you are extracting should do, for instance replacing a value in a Text Input tool.
One way to see if your app is doing what you want it to do is to go to the Reporting tab and select either ‘Report Text’ or ‘Table’ and add that right after your text input tool. Then finish that off with a ‘Render’ tool, which will create an output that your app can open once it completes running. When you configure your interface (View > Interface Designer or Ctrl+Alt+D) and go to Settings the render tool will appear as one of your file options to be shown on success. If you tick this and then test your app an interface with your App Results should show up with a list of the output files that can be opened. Now just click ok and you will be shown your output.