Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Insert excerpt
HELP100:_BannersHELP100:
_Banners
nameanalysisscreen
nopaneltrue

Overview

When creating apps or testing functionality, it is often necessary to create test data. There are a number of ways to quickly create test data in PhixFlow, which can be manually edited and added to. 

Creating an Editable Grid

Data can be manually added or updated using do this in PhixFlow. The following methods will be covered:

  • Creating an Editable Grid - This method creates a spreadsheet-style screen, that allows you to edit and update data. This method is best when using existing data
  • Using External APIs - This method is best for creating large datasets using a third-party data generator (mockeroo.com)
  • Using Input/Output Multipliers - This method is best for small datasets, with specific examples. The data can be easily rolled back and reset to its original state. For example, testing the results of a function



Video

Iframe
allowfullscreentrue
srchttps://www.youtube.com/embed/HBvrPeLJ2_M?si=q623PIXOjczJsTKL&rel=0&ytp-pause-overlay=0&list=PLbPt6SI1Zhb9JAD6TfD-qGC6vzZXOznvn
width800
height450


Creating an Editable Grid 
Anchor
Grid
Grid

Use a simple ERD and Screen setup to create an editable grid. 

Creating

Step 1: Create a table

Expand
titleHow?
  1. On an

    Insert excerpt

HELP100:
  1. _erd

HELP100:
  1. _erd
    nopaneltrue
    , either:

    1. Create a new table by dragging

      Insert excerpt

HELP100:
    1. _tables

HELP100:
    1. _tables
      nopaneltrue
       from the toolbar onto your ERD canvas

    2. Add an existing table by clicking 
      Insert excerpt
HELP100:
    1. _tables
HELP100:
    1. _tables
      nopaneltrue
       on the toolbar, then dragging a table from the
      Insert excerpt
HELP100:
    1. _repository
HELP100:
    1. _repository
      nopaneltrue
       onto your ERD canvas 
    2. Import
an Excel
    1. a CSV file by dragging it from your PC onto your ERD canvas
  1. If you create a new table, PhixFlow automatically adds the following attributes to the table:

    1. Insert excerpt

HELP100:
    1. _key_primary

HELP100:
    1. _key_primary
      nopaneltrue
      : UID

    2. Insert excerpt

HELP100:
    1. _display_name

HELP100:
    1. _display_name
      nopaneltrue
      : Name 

Add as many new attributes to your table as you need by clicking 
  1. If you import a CSV file, add the above UID attribute to your table and set it as the 
    Insert excerpt
    _key_primary
    _key_primary
    nopaneltrue
     
  2. Add the attributes you require to your table by clicking 

    Insert excerpt

HELP100:
  1. _addIcon

HELP100:
  1. _addIcon
    nopaneltrue
    Add on the table, and give your attributes appropriate

names
  1. names

    1. New attributes only require a valid Name and Type
    2. Image Modified
Creating

Step 2: Create a Screen 

Expand
titleHow?
  1. To create a screen using your ERD data, click 
    Insert excerpt
HELP100:
  1. _more_options_erd_IconOnly
HELP100:
  1. _more_options_erd_IconOnly
    nopaneltrue
     on your table and choose 
    Insert excerpt
HELP100:
  1. _screen_icon_only
HELP100:
  1. _screen_icon_only
    nopaneltrue
     Create Screen
  2. On the Create Screen wizard, enter the following:
    1. Name: give your screen an appropriate
name
    1. name 
    2. Open Maximised: toggle 
      Insert excerpt
HELP100:
    1. _toggle_off
HELP100:
    1. _toggle_off
      nopaneltrue
    2. Description: give your screen an appropriate description to indicate its purpose
    3. Template: choose Tile with Buttons, Tile no Buttons or Edit Form
    Image Removed
        1. For this example, Edit Form has been chosen
      1. Click Create Screen
    1. The Available Attributes selector will automatically appear
    , press the cross to close this
    To select the attributes you wish to see on your screen, select Insert excerptHELP100:_attributesHELP100:_attributesnopaneltrue in the toolbar 
    1. Click the tickbox next to each attribute, or click the top tickbox to select all of the attributes, and drag them onto your screen
      Image Removed
        1. Image Added
      1. PhixFlow will ask how you would like the attributes to be displayed, choose
        Insert excerpt
      HELP100:
      1. _grid
      HELP100:
      1. _grid
        nopaneltrue
      Image Removed
        1. Image Added
      1. PhixFlow will ask if you would like to add actions, choose Yes
        1. Image Modified
      2. On the Grid Actions wizard, drag Delete Selected Records onto the Delete button on your screen - this is the only button you need 
        1. Image Modified
      3. Close the Grid Actions and Available Attribute wizards
      Setting

      Step 3: Set up the Screen

      Click

      Expand
      titleHow?
      1. Right-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 
      1. Image Removed
    3. In the View Properties, toggle on 
      1. and select
        Insert excerpt
        _view_show_config
        _view_show_config
        nopaneltrue
        1. Image Added
      2. On the
        Insert excerpt
      HELP100:
      1. _
      toggle
      1. property_
      on
      1. tabs
      HELP100:
      1. _
      toggle_on
      1. property_tabs
        nameaction
        nopaneltrue
       Auto SaveClick
      1. , toggle on 
        Insert excerpt
      HELP100:
      1. _toggle_
      finish
      1. on
      HELP100:
      1. _toggle_
      finish
      1. on
        nopaneltrue
      With
      1.  Auto Save
      set up, the screen no longer requires a Save buttonTo delete the Save button, click on it on the screen to highlight it in the Layers, right click it in Layers and select 
        1. Note: Enabling Auto Save automatically saves any changes made to the data 
        2. Click 
          Insert excerpt
      HELP100:
        1. _
      permanentlyDelete
        1. finish
      HELP100:
        1. _
      permanentlyDelete
        1. finish
          nopaneltrue
      1. In the Layers panel, click on the area
      FieldContainer to
      1. containing the grid to open its Properties on the right
      2. Click on the 
        Insert excerpt
      HELP100:
      1. _property_tabs
      HELP100:
      1. _property_tabs
        namestyle
        nopaneltrue
         and within the Style Settings section,
      change
      1. ensure the Width and Height to 100% 
        Click
          1. Click 
            Insert excerpt
        HELP100:
          1. _finish
        HELP100:
          1. _finish
            nopaneltrue
        1. Click on the Name attribute header on the grid to open the View Attribute Properties on the right
          1. Image Added
        2. On the 
          Insert excerpt
        HELP100:
        1. _property_tabs
        HELP100:
        1. _property_tabs
          namestyle
          nopaneltrue
          ,
        within
        1. in the Grid Settings section, untick Read Only
          1. In PhixFlow version 11 and older, this option is on the 
            Insert excerpt
            _property_tabs
            _property_tabs
            nopaneltrue
          2. Click 
            Insert excerpt
            _finish
            _finish
            nopaneltrue
        2. 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
        3. Then
        click
        1. click 
          Insert excerpt
        HELP100:
        1. _finish
        HELP100:
        1. _finish
          nopaneltrue
        2. With Auto Save set up, the screen no longer requires a Save button
        3. To delete the Save button, click on it on the screen to highlight it in the Layers, right click it in Layers and select 
          Insert excerpt
          _permanentlyDelete
          _permanentlyDelete
          nopaneltrue

        Adding a Button

        1. Open the Palette by clicking 
          Insert excerpt
        HELP100:
        1. _palette
        HELP100:
        1. _palette
          nopaneltrue
           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:

        Image Modified

        Adding

        Step 4: Add New Records via an Actionflow

        Expand
        titleHow?
        1. Right-click on your new Add button and choose 
          Insert excerpt
        HELP100:
        1. _actionflow_add
        HELP100:
        1. _actionflow_add
          nopaneltrue
          1. Give your
        actionflow
          1. Actionflow a name
        1. To configure the input connection, within the Connections section on the left, click on Click to Connect
        2. Choose the On Click Action Event, then select Connect Input
        3. Drag
        the Calculate node from
        1. Insert excerpt
          _action_calculate
          _action_calculate
          nopaneltrue
           action from the toolbar onto the canvas
          1. Give it a suitable name
        2. The
        Properties for the Calculate node will
        1. Insert excerpt
          _property_settings
          _property_settings
          nopaneltrue
           for the Calculate action will show on the right
          1. If these are not open, click the Calculate action to reopen them
        2. In the Output Attributes section, add a new attribute by selecting 
          Insert excerpt
        HELP100:
        1. _addIcon
        HELP100:
        1. _addIcon
          nopaneltrue
          1. Give it a name and set the expression to "new"
        2. Drag
        the Save node from
        1. a
          Insert excerpt
          _action_save
          _action_save
          nopaneltrue
           action from the toolbar onto the canvas
        , give
          1. Give it a name
        , set
          1. Set the Type to Auto Insert/Update
        , and from
          1. On the Table dropdown list, choose
        your table
          1. the table you made earlier on your ERD
        1. Connect the out pipe from the Calculate node to the Save node
          Image Removed
            1. Image Added
          1. Map across your Output Attribute from the Calculate node onto the Save node
            Image Removed
              1. Image Added
            1. Drag the Input Connection Point onto the Calculate node 
              Image Removed
                1. Image Added
              1. Close the Actionflow and open the screen you created earlier
              2. Insert excerpt
              HELP100:
              1. _lock
              HELP100:
              1. _lock
                nopaneltrue
                 the screen, then select the Add button
              2. The Actionflow will fire and a new record will be created on the grid, with a unique ID (UID)
                1. Image Modified
              3. Double click on the fields to manually enter information 
              4. Repeat these steps of adding a new record and updating the information as many times as required
              5. Each record will save automatically

              Check Point

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

              Using

              Input MultipliersComing soon

              External APIs 
              Anchor
              API
              API

              Configure an

              Insert excerpt
              _analysisModel
              _analysisModel
              nopaneltrue
               to import data stored outside of PhixFlow using an API.

              Create a Multi-Record Table using an API

              This example uses the below three elements to create dynamic data. The table in this example will pull across data, as stipulated by the attributes, and this data will change each time the user clicks 

              Insert excerpt
              _run_analysis
              _run_analysis
              nopaneltrue
              .

              The HTTP Datasource is used to connect to the external source, the HTTP Collector then reads the data, and the Table stores the data in PhixFlow. 

              Image Added

              For more information on how these three elements work and for a detailed example, see Importing Data Through an API.

              Expand
              titleHow?
              1. Prepare your API data and ensure it is in JSON format. For this example, we have created a data schema and mock API using https://www.mockaroo.com/mock_apis
              2. On an 
                Insert excerpt
                _analysisModel
                _analysisModel
                nopaneltrue
                , create a new 
                Insert excerpt
                _http_datasource
                _http_datasource
                nopaneltrue
              3. Set up your 
                Insert excerpt
                _http_datasource
                _http_datasource
                nopaneltrue
                 Properties to look similar to the below settings, and ensure your URL matches your API source
                1. Image Added
              4. Hover over your
                Insert excerpt
                _http_datasource
                _http_datasource
                nopaneltrue
                 and select 
                Insert excerpt
                _http_collector_add_new
                _http_collector_add_new
                nopaneltrue
                 on the hover menu
              5. Set up the 
                Insert excerpt
                _http_collector
                _http_collector
                nopaneltrue
                 Properties to look similar to the below settings, and ensure your URL passes in your API key
                1. Image Added
              6. Hover over your 
                Insert excerpt
                _http_collector
                _http_collector
                nopaneltrue
                 and select 
                Insert excerpt
                _table_new
                _table_new
                nopaneltrue
              7. Set up the 
                Insert excerpt
                _tables
                _tables
                nopaneltrue
                 Properties to look similar to the below settings, and ensure the 
                Insert excerpt
                _attributes
                _attributes
                nopaneltrue
                 you wish to display on your view are set up
                1. Image Added
              8. Insert excerpt
                _run_analysis
                _run_analysis
                nopaneltrue
                 on your 
                Insert excerpt
                _tables
                _tables
                nopaneltrue
                , then 
                Insert excerpt
                _view_show
                _view_show
                nopaneltrue
                 to see your data
                1. Image Added

              Using Input and Output Multipliers 
              Anchor
              Multiplier
              Multiplier

              Use a simple table configuration on an 

              Insert excerpt
              _analysisModel
              _analysisModel
              nopaneltrue
              .

              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.

              Expand
              titleHow?
              1. On an 
                Insert excerpt
                _analysisModel
                _analysisModel
                nopaneltrue
                , create a blank Calculate 
                Insert excerpt
                _tables
                _tables
                nopaneltrue
              2. Within the Table's 

                Insert excerpt
                _property_tabs
                _property_tabs
                nopaneltrue
                , add 
                Insert excerpt
                _attributes
                _attributes
                nopaneltrue
                 to the table, which will act as column headers

                1. Add the Expression _inputMultiplier, followed by .1, .2, .3, etc. to the relevant attributes
                2. Image Added
              3. In the Analysis Options section, in the Input Multiplier box, add an array, like the example here

                1. Code Block
                  titleInput Multiplier
                  [
                      [1,'CHAIR',100],
                      [2,'TABLE',430],
                      [3,'MONITOR',800]
                  ]


              4. Insert excerpt
                _finish
                _finish
                nopaneltrue
                 the Properties, then 
                Insert excerpt
                _run_analysis
                _run_analysis
                nopaneltrue
                 on the table
                1. Hover over the table and select 
                  Insert excerpt
                  _view_show
                  _view_show
                  nopaneltrue
                2. For this example, the data shows three records, with each record assigned the UID, Item name and Quantity as specified by the Input Multiplier, along with the Last Updated date 
                3. Image Added


              Tip

              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 the table should run

              Image Added