Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 20 Next »

Overview

There are a number of ways to quickly create test data in PhixFlow, which can be manually edited and added to.  On this page, the following methods will be covered:

Creating an Editable Grid - This method is best for using existing data and making amendments.

Using Input/Output Multipliers - This method is best for small datasets, with specific examples. For example, testing the results of a function.

Using External APIs - This method is best for large datasets and existing data.

Creating an Editable Grid 

Use a simple ERD and Screen setup. 

Step 1: Create a table

 How?
  1. On an  ERD, either:

    1. Create a new table by dragging  Table from the toolbar onto your ERD canvas

    2. Add an existing table by clicking  Table on the toolbar, then dragging a table from the  Repository onto your ERD canvas 
    3. Import an Excel CSV file by dragging it from your PC onto your ERD canvas
  2. If you create a new table, PhixFlow automatically adds the following attributes to the table:

    1.   Primary key: UID

    2.   Display Name: Name 

  3. Add as many new attributes to your table as you need by clicking Add on the table, and give your attributes appropriate names

Step 2: Create a Screen 

 How?
  1. To create a screen using your ERD data, click  on your table and choose screen Create Screen
  2. On the Create Screen wizard, enter the following:
    1. Name: give your screen an appropriate name
    2. Open Maximised: toggle 
    3. Description: give your screen an appropriate description to indicate its purpose
    4. Template: choose Edit Form
    5. Click Create Screen
  3. The Available Attributes selector will automatically appear, press the cross to close this
  4. To select the attributes you wish to see on your screen, select  Attributes in the toolbar 
  5. Click the tickbox next to each attribute, or click the top tickbox to select all the attributes, and drag them onto your screen
  6. PhixFlow will ask how you would like the attributes to be displayed, choose  Grid
  7. PhixFlow will ask if you would like to add actions, choose Yes
  8. On the Grid Actions wizard, drag Delete Selected Records onto the Delete button on your screen 
  9. Close the Grid Actions and Available Attribute wizards

Step 3: Set up the Screen

 How?
  1. Click on the grid on your screen to highlight it in the Layers panel on the left within the Body
  2. The View Component Properties will show on the right, click the View hyperlink 
  3. In the View Properties, toggle on  Auto Save
  4. Click Apply and Close
  5. In the Layers panel, click on the area FieldContainer to open its Properties on the right
  6. Click on the  Styles tab and within the Style Settings section, change the Width and Height to 100%
  7. Click Apply and Close
  8. Click on the Name header on the grid to open the View Attribute Properties on the right
  9. On the  Properties tab, within the Grid Settings section, untick Read Only
  10. Repeat this step for all of your attribute headers, except UID
    1. Note: Unticking Read Only will allow you to manually enter information into these columns on your grid
  11. Then click Apply and Close
  12. With Auto Save set up, the screen no longer requires a Save button
  13. To delete the Save button, click on it on the screen to highlight it in the Layers, right click it in Layers and select  Permanently Delete

Adding a Button

  1. Open the Palette by clicking  Palette on the toolbar
  2. Expand the Buttons - Primary section and drag the Add button onto your screen - the screen will highlight the areas where the button should be dropped
  3. Give your button a name
    1. Optional: In the Layers panel, expand the area Window CRUD Bar. Then, while holding shift, drag and drop your Add button onto either the Left or Right area within the Window CRUD Bar

Check Point

At this point, your screen should look similar to this:

Step 4: Add New Records via an Actionflow

 How?
  1. Right-click on your new Add button and choose  Add Actionflow
  2. Give your actionflow a name
  3. To configure the input connection, within the Connections section on the left, click on Click to Connect
  4. Choose the On Click Action Event, then select Connect Input
  5. Drag the Calculate node from the toolbar onto the canvas
  6. Give it a name
  7. The Properties for the Calculate node will show on the right
  8. In the Output Attributes section, add a new attribute by selecting 
  9. Give it a name and set the expression to "new"
  10. Drag the Save node from the toolbar onto the canvas, give it a name, set the Type to Auto Insert/Update, and from the Table dropdown list, choose your table
  11. Connect the out pipe from the Calculate node to the Save node
  12. Map across your Output Attribute from the Calculate node onto the Save node
  13. Drag the Input Connection Point onto the Calculate node 
  14. Close the Actionflow and open the screen you created earlier
  15.  Lock the screen, then select the Add button
  16. The Actionflow will fire and a new record will be created on the grid, with a unique ID (UID)
  17. Double click on the fields to manually enter information 
  18. Repeat these steps of adding a new record and updating the information as many times as required
  19. Each record will save automatically

Check Point

At this point, your screen should look similar to this:

Using Input and Output Multipliers 

Use a simple table configuration on an Analysis Model. 

On an  Analysis Model, create a Calculate  Table by dragging the  Calculate icon from the toolbar onto the canvas.

Create a Single Record Table

This example uses one number to prevent the need for input pipes. The table in this example will produce one record.

 How?
  1. Within the Table's  Properties tab, add  Attributes to the table, which will act as column headers

    1. The Expression for one of your attributes must be _inputMultiplier
  2. In the Analysis Options section, in the Input Multiplier box, add any number
  3.  Apply and Close the Properties, then  Run Analysis on the table
    1. Hover over the table and select  Show view
    2. For this example, the data will show one record, with the number 3 recorded against the attribute Region Number, as this was the Input Multiplier attribute 

To create a table with no records, follow the above steps but instead of adding a number to the Input Multiplier box, instead write _NULL

Create a Multi-Record Table using the Syntax 1..n 

This example uses the syntax 1..n to run a table multiples times. The numerical difference between the two numbers will determine the number of records returned. For example, using the Input Multiplier 1..10 will return ten records.

 How?
  1. Within the Table's  Properties tab, add  Attributes to the table, which will act as column headers

    1. The Expression for one of your attributes must be _inputMultiplier
  2. In the Analysis Options section, in the Input Multiplier box, add any 2 numbers separated by .. e.g. 1..10
    1. Remember, the first number must be smaller than the second number
  3.  Apply and Close the Properties, then  Run Analysis on the table
    1. Hover over the table and select  Show view
    2. For this example, the data will show ten records, with each record assigned a unique number between 1 and 10 

Create a Multi-Record Table using an Array

This example uses an array to create static data. The table in this example will produce the exact records as stipulated in the Input Multiplier.

 How?
  1. Within the Table's  Properties tab, add  Attributes to the table, which will act as column headers

    1. The Expression for all of your attributes must be _inputMultiplier, followed by .1, .2, .3, etc.
  2. In the Analysis Options section, in the Input Multiplier box, add an array, like the example here
    1. Input Multiplier
      [
          [1,'CHAIR',100],
          [2,'TABLE',430],
          [3,'MONITOR',800]
      ]
  3.  Apply and Close the Properties, then  Run Analysis on the table
    1. Hover over the table and select  Show view
    2. For this example, the data will show three records, with each record assigned the UID, Item name and Quantity as specified by the Input Multiplier  

Alternatively, an Output Multiplier can be used to create data. Repeat the steps above, but with the following changes:

  1. The Expression for all of your attributes must be _outputMultiplier, followed by .1, .2, .3, etc.
  2. Add the same array as above, but to the Output Multiplier box
  3. Add 1 in the Input Multiplier box to indicate the number of times table should run

Using External APIs 

Coming soon

  • No labels