Using Truth Tables to Dynamically Pass an Image to a Form
  • 01 Oct 2021
  • 1 Minute to read
  • Dark
    Light
  This documentation version is deprecated, please click here for the latest version.

Using Truth Tables to Dynamically Pass an Image to a Form

  • Dark
    Light

Article summary

Overview

Truth Tables can be used to dynamically pass File Data like images to a Form. 

Example

In this example, a Truth Table is used to output an image to a Form. The Truth Table is executed by using the output of a random number generator and will output image A if the number is even and image B if the number is odd. The corresponding image is then passed to the Form and displayed to the user.

  1. In a Designer Project, click CREATE FLOW and select Flow. Name the Flow and click CREATE.
  2. Click the Done path on the Start step. Navigate to All Steps [Catalog] > Data > Numbers, select the Get Random Int step, and click ADD.
  3. Enter "99" as a value for Max on the Properties panel.
  4. Click the Done path and add a Run Truth Table step.
  5. Click PICK OR CREATE TRUTHTABLE and select CREATE. Select Truth Table, name the Truth Table and click CREATE.
  6. Click SETUP INPUT DATA and click DEFINE.

  7. Enter "Company Name" as the Input Data Name and change the TYPE to Int32 [Number]. Click Save and close the window.
  8. Click Select Data Element and select Company Name. Click CLOSE.
  9. On the Pick Verb dialog, select Is Even and click CLOSE.
  10. Hover over the Default Output Data and click the pencil icon. Change the Type to File Data and click OK.
  11. Select the cell under the Default Output Data column and add a file. Click CLOSE.
  12. Click Click To Add Row to add a row and add another file. Click the checkbox on one of the options. Click Save and close the Truth Table.
  13. Click the Done path and add a Show Form step. Click PICK OR CREATE FORM and click CREATE. Select Form, name the Form, and click CREATE.
  14. Configure the Form to have an Image component (Image) and a Button component (DONE). Click Save and close the Form.
  15. Select the Truth Table. Click Edit Input Mapping.
  16. Connect Get Random Int_Output to Company Name and click OK.
  17. Select the Image Form and map Result.All Contents.
  18. Connect the DONE path to the End step. Click Save to save all changes.


Debug

  1. On the top action bar, click Debug. Click START DEBUGGING. 
  2. The debugger will run and will display an image. Click DONE to close the Form. Click CREATE NEW SESSION to generate the Form again.



Was this article helpful?