Versions Compared

Key

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

Insert excerpt
_Banners
_Banners
nameactionflow
nopaneltrue

What is a View Action?

The 

Insert excerpt
_action_view
_action_view
nopaneltrue
 action selects and filters additional data to use in an Actionflow. This is useful where the originating screen or component does not include all of the data that the Actionflow requires. 

Creating View Actions

required by the Actionflow. 


Expand
titleViews vs Lookups


Excerpt
nameLookupVsView

Views vs Lookups

There are two kinds of View.

Section


Column

Views

Insert excerpt
_action_view
_action_view
nopaneltrue
s return a set of individual records which flow through the Actionflow one-by-one.

Typically, Views are used where the data requires processing, e.g. sending emails to individuals.

This is the most common type of view.

See /wiki/spaces/HELP12/pages/9615626449


Column

Lookups

Lookups are a type of View but they return records as an array within one recordset

Generally, Lookups are used where data requires listing, e.g. to display in a filter.

See /wiki/spaces/HELP12/pages/9615626261


Image Added

Iframe
allowfullscreentrue
srchttps://www.youtube.com/embed/MSEapZ21_5M?si=mvAuduMmvGgXjkwM?&rel=0&ytp-pause-overlay
width680
alignmiddle
height400


Creating View Actions

Iframe
allowfullscreentrue
srchttps://www.youtube.com/embed/BRK7RUYUJV8?si=93oVze096f7bT7p-?&rel=0&ytp-pause-overlay
width680
alignmiddle
height400

  1. Click the 
    Insert excerpt
    _action_view
    _action_view
    nopaneltrue
     icon in the toolbar to display existing tables in the application
    1. Existing tables can be dragged from the Repository onto the canvas - choose
      Insert excerpt
      _action_view
      _action_view
      nopaneltrue
       in the pop-up box to create a View action node
  2. Alternatively, drag the 
    Insert excerpt
    _action_view
    _action_view
    nopaneltrue
     icon from the toolbar onto the canvas and select a primary table to view from the drop down list


HTML Comment
hiddentrue

Insert excerpt
View Node
View Node
nopaneltrue

Worked Examples

Here's a worked example using the School Data (available from the Learning Centre).

We want to be able to add and edit the courses. The first step to doing this is by creating two Open Screen Actionflows. Both will open the same screen containing an input form, but when we are adding a new course, we want an empty input form, and when we are editing an existing course, we want the input form to contain course data. SCREENSHOTS?

Tip

If you are completing this chapter as part of the Actionflow course and using a training instance, the data and screens have already been pre-loaded into the Actionflow Application. For this example, we'll be working on the Course Management screen and opening the Course Form screen

Example Uses

Insert excerpt
_action_view
_action_view
nopaneltrue
 actions are useful in these example scenarios.

Example: Many Attributes are Needed in the Actionflow

Solution: Rather than map all of these attributes into the Actionflow, the primary key can be mapped in and a

Insert excerpt
_action_view
_action_view
nopaneltrue
 used to access all of the other attributes.

Example: Not all Attributes are Displayed on the Screen

Solution: Where attributes from the table are needed in the Actionflow but are not displayed on the screen,

Insert excerpt
_action_view
_action_view
nopaneltrue
s can be used to access all of the attributes in the table.

Worked Example

Here's a worked example using the School Data (available from the Learning Centre).

In this example, we are using:

Click on the input connection point to open the Connector Mappings
  • a Course A Teacher Management screen containing a grid of the School Courses Teachers data - the screen was created using the Tile with Buttons templatea
  • Course A Teacher Form screen containing form fields , and associated with School Courses Teachers data by a background filter - the screen was created using the Edit Form template

To save the new or edited course, the Save Action on the input form must be configured. See 1.09 Save Action Configuration.

Note: When creating a new screen in PhixFlow, a Grid Actions wizard can configure the Create, Read, Update and Delete (CRUD) actions for you. For the purposes of understanding the mechanics of Actionflows, we will create these manually.

Updating data for one table dynamically updates data in another table

Setup the View Action

  • Open the Save Actionflow for the Teachers Form
    • A Course Management screen containing a grid of the School Courses data - the screen was created using the Tile with Buttons template
    Tip

    If you are completing this chapter as part of the Actionflow course and using a training instance, the data and screens have already been pre-loaded into the Actionflow Foundation Application. For this example, we'll be added extra functionality to a button on the Teacher Form.

    We want the status of a course to be dynamically updated to On Hold if the associated teacher's status is changed to Inactive. To do this, we will add

    Insert excerpt
    _action_view
    _action_view
    nopaneltrue
     and
    Insert excerpt
    _action_calculate
    _action_calculate
    nopaneltrue
     actions to a Save Actionflow.

    Image Added

    Dynamic Updates Between Tables

    Using a View Action, modify the Save Actionflow for the School Teachers data to dynamically retrieve and update the School Courses data.

    Configure a View Action

    Create a View Action to access the School Courses data within an Actionflow for the School Teachers data.

    1. Open the
      Insert excerpt
      _save_icon
      _save_icon
      nopaneltrue
       Save Actionflow for the Teacher Form
    2. Right-click on the input connection point, under Connections, and select 
      Insert excerpt
      _mappings_configure
      _mappings_configure
      nopaneltrue
    3. Drag the TeacherStatus attribute from the left to into the Drag and Drop area on the right 
      1. Click Save
    4. Drag a View Action
      Insert excerpt
      _action_view
      _action_view
      nopaneltrue
       Action from the toolbar onto the canvas
      1. Name: Get Courses
      2. Primary Table: choose School Courses Courses 
      3. Select Create Action
    5. Drag and drop the View action you just created Get Courses 
      Insert excerpt
      _action_view
      _action_view
      nopaneltrue
      Action onto the in connector between the input node and the Save action
      Insert excerpt
      _input
      _input
      nopaneltrue
       Node and the
      Insert excerpt
      _action_save
      _action_save
      nopaneltrue
       Action
    6. Click on the in connector between the input node and the View node the 
      Insert excerpt
      _input
      _input
      nopaneltrue
       node and the 
      Insert excerpt
      _action_view
      _action_view
      nopaneltrue
      Action to open the Mappings
    7. Drag both the TeacherID and TeacherStatus attributes (hold Ctrl to multi-select) from the left to the Drag into the Drag and Drop area on the right
      1. Select Save
    8. Click on the View Action to open the propertiesIn the Output Attributres sectionthe Get Courses 
      Insert excerpt
      _action_view
      _action_view
      nopaneltrue
       Action to open its 
      Insert excerpt
      _property_settings
      _property_settings
      nopaneltrue
      1. In the Output Attributes section, select the 
        Insert excerpt
        _attributes_icon
        _attributes_icon
        nopaneltrue
         icon
        1. Drag the CourseID and CourseStatus attributes into the Output Attributes section in the properties
          Insert excerpt
          _property_settings
          _property_settings
          nopaneltrue
        2. Select OK
      2. In the Data Retrieval Options section, click the 
        Insert excerpt
        _addIcon
        _addIcon
        nopaneltrue
         next to Filter and create a filter:
        1. Name: ByTeacher
        2. Filter Details: 
          1. Click abc to tell PhixFlow to interpret the field as an expression
        3. Select 
          Insert excerpt
          _finish
          _finish
          nopaneltrue
      3. Select 
        Insert excerpt
        _finish
        _finish
        nopaneltrue
         on the properties
    Setup the
      1. Insert excerpt
        _property_settings
        _property_settings
        nopaneltrue
    Expand
    titleCheckpoint

    Image Added

    Configure a Calculate Action

    Drag

    Create a

    View Action

    Calculate Action to alter the CourseStatus data based on the TeacherStatus data.

    1. Drag a 
      Insert excerpt
      _action_calculate
      _action_calculate
      nopaneltrue
       Action from the toolbar onto the canvas
      1. Name: Change  Change Course Status
      2. Select Create Action
    2. Drag and drop the Calculate action you just created Change Course Status 
      Insert excerpt
      _action_calculate
      _action_calculate
      nopaneltrue
       action onto the in connector between the View action node and the Save action nodethe 
      Insert excerpt
      _action_view
      _action_view
      nopaneltrue
       action and the
      Insert excerpt
      _action_save
      _action_save
      nopaneltrue
       action
    3. Click on the in connector between the View action node and the Calculate action nodethe 
      Insert excerpt
      _action_view
      _action_view
      nopaneltrue
       action and the 
      Insert excerpt
      _action_calculate
      _action_calculate
      nopaneltrue
       action to open the Mappings
    4. Map across the CourseStatus, TeacherID and TeacherStatus attributes, as these are needed for the Calculate actionthe 
      Insert excerpt
      _action_calculate
      _action_calculate
      nopaneltrue
       action
      1. Select Save
    5. Click on the Calculate action to open its propertiesIn the output attribute the 
      Insert excerpt
      _action_calculate
      _action_calculate
      nopaneltrue
       action to open its 
      Insert excerpt
      _property_settings
      _property_settings
      nopaneltrue
       
    6. In the Output Attribute section, click 
      Insert excerpt
      _add_icon
      _add_icon
      nopaneltrue
       to create a new attribute:
      1. Name: NewCourseStatus
      2. Type: Choose String
      3. Expression: 


        Code Block
        languagejs
        themeEmacs
        // If TeacherStatus is Inactive, set CourseStatus to On Hold
        if(
            in.TeacherStatus == "Inactive", $pfCourseStatus = "On Hold",
        
        // Else, set CourseStatus to Open
            $pfCourseStatus = "Open"
        )


      4. Select 
        Insert excerpt
        _finish
        _finish
        nopaneltrue
    Expand
    titleCheckpoint

    Image Added

    Configure an Additional Save Action

    As we are modifying the Save Actionflow for the Teachers table, we need an additional

    Insert excerpt
    _action_save
    _action_save
    nopaneltrue
     Action to save the NewCourseStatus to the Courses table.

    1. Drag a
      Insert excerpt
      _action_save
      _action_save
      nopaneltrue
       Action from the toolbar onto the canvas
      1. Name: Save Courses
      2. Table: Choose the School Courses table
      3. Select Create Action
    2. In the 
      Insert excerpt
      _action_save
      _action_save
      nopaneltrue
       Action's Properties, toggle on
      Insert excerpt
      _toggle_on
      _toggle_on
      nopaneltrue
       Auto Save Attributes
    3. Select
      Insert excerpt
      _finish
      _finish
      nopaneltrue
    4. Hover over the 
      Insert excerpt
      _action_calculate
      _action_calculate
      nopaneltrue
       action and select out
    5. When the red arrow shows, click on the 
      Insert excerpt
      _action_save
      _action_save
      nopaneltrue
       Courses action node
    6. On the Mappings window:
      1. Drag the NewCourseStatus attribute from the left onto the CourseStatus attribute on the right
      2. Drag the CourseID attribute from the left onto the CourseID attribute on the right
      3. Select Save

        Expand
        titleCheckpoint

        Image Added


    7. Close the Actionflow and return to the Teacher Management screen
    8. Insert excerpt
      _lock
      _lock
      nopaneltrue
       the screen and select a record to Edit
    9. On the Teacher Form, change the teacher's Status to Inactive and press Save
      1. To see that the Actionflow has worked, open the Course Management screen
      2. Any course(s) assigned to the teacher you just updated should have a Status of On Hold


    Image Modified