What is a View Action?
The Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
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 required by the Actionflow.
Excerpt |
---|
|
Views vs LookupsThere are two kinds of View. Section |
---|
Column |
---|
Views Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
| 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. |
Column |
---|
LookupsLookups 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 1.16 Lookup Configuration |
|
|
Creating View Actions
- Click the
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
icon in the toolbar to display existing tables in the application- Existing tables can be dragged from the Repository onto the canvas - choose
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
in the pop-up box to create a View action node
- Alternatively, drag the
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
icon from the toolbar onto the canvas and select a primary table to view from the drop down list
HTML Comment |
---|
|
Insert excerpt |
---|
| View Node |
---|
| View Node |
---|
nopanel | true |
---|
|
|
Example Uses
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
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 |
---|
nopanel | true |
---|
|
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 |
---|
nopanel | true |
---|
|
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:
- A Teacher Management screen containing a grid of the School Teachers data - the screen was created using the Tile with Buttons template
- A Teacher Form screen containing form fields and associated with School Teachers data by a background filter - the screen was created using the Edit Form template
- 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 |
---|
nopanel | true |
---|
|
and Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
actions to a Save Actionflow.
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.
Create a View Action to access the School Courses data within an Actionflow for the School Teachers data.
- Open the
Insert excerpt |
---|
| _save_icon |
---|
| _save_icon |
---|
nopanel | true |
---|
|
Save Actionflow for the Teacher Form - Right-click on the input connection point, under Connections, and select
Insert excerpt |
---|
| _mappings_configure |
---|
| _mappings_configure |
---|
nopanel | true |
---|
|
- Drag the TeacherStatus attribute from the left into the Drag and Drop area on the right
- Click Save
- Drag a
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
Action from the toolbar onto the canvas- Name:
Get Courses
- Primary Table: choose School Courses
- Select Create Action
- Drag and drop the Get Courses
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
Action onto the in connector between the Node and the Insert excerpt |
---|
| _action_save |
---|
| _action_save |
---|
nopanel | true |
---|
|
Action - Click on the in connector between the node and the
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
Action to open the Mappings - Drag both the TeacherID and TeacherStatus attributes from the left into the Drag and Drop area on the right
- Select Save
- Click on the Get Courses
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
Action to open its Insert excerpt |
---|
| _property_settings |
---|
| _property_settings |
---|
nopanel | true |
---|
|
- In the Output Attributes section, select the
Insert excerpt |
---|
| _attributes_icon |
---|
| _attributes_icon |
---|
nopanel | true |
---|
|
icon- Drag the CourseID and CourseStatus attributes into the Output Attributes section in the
Insert excerpt |
---|
| _property_settings |
---|
| _property_settings |
---|
nopanel | true |
---|
|
- Select OK
- In the Data Retrieval Options section, click the
Insert excerpt |
---|
| _addIcon |
---|
| _addIcon |
---|
nopanel | true |
---|
|
next to Filter and create a filter:- Name:
ByTeacher
- Filter Details:
- Select
Insert excerpt |
---|
| _finish |
---|
| _finish |
---|
nopanel | true |
---|
|
- Select
Insert excerpt |
---|
| _finish |
---|
| _finish |
---|
nopanel | true |
---|
|
on the Insert excerpt |
---|
| _property_settings |
---|
| _property_settings |
---|
nopanel | true |
---|
|
Expand |
---|
|
|
Create a Calculate Action to alter the CourseStatus data based on the TeacherStatus data.
- Drag a
Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
Action from the toolbar onto the canvas- Name:
Change Course Status
- Select Create Action
- Drag and drop the Change Course Status
Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
action onto the in connector between the Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
action and the Insert excerpt |
---|
| _action_save |
---|
| _action_save |
---|
nopanel | true |
---|
|
action - Click on the in connector between the
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
action and the Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
action to open the Mappings - Map across the CourseStatus, TeacherID and TeacherStatus attributes, as these are needed for the
Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
action- Select Save
- Click on the
Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
action to open its Insert excerpt |
---|
| _property_settings |
---|
| _property_settings |
---|
nopanel | true |
---|
|
- In the Output Attribute section, click
Insert excerpt |
---|
| _add_icon |
---|
| _add_icon |
---|
nopanel | true |
---|
|
to create a new attribute:
- Name:
NewCourseStatus
- Type: Choose
String
Expression:
Code Block |
---|
|
// If TeacherStatus is Inactive, set CourseStatus to On Hold
if(
in.TeacherStatus == "Inactive", $pfCourseStatus = "On Hold",
// Else, set CourseStatus to Open
$pfCourseStatus = "Open"
) |
- Select
Insert excerpt |
---|
| _finish |
---|
| _finish |
---|
nopanel | true |
---|
|
Expand |
---|
|
|
As we are modifying the Save Actionflow for the Teachers table, we need an additional
Insert excerpt |
---|
| _action_save |
---|
| _action_save |
---|
nopanel | true |
---|
|
Action to save the NewCourseStatus to the Courses table.
- Drag a
Insert excerpt |
---|
| _action_save |
---|
| _action_save |
---|
nopanel | true |
---|
|
Action from the toolbar onto the canvas- Name:
Save Courses
- Table: Choose the School Courses table
- Select Create Action
- In the
Insert excerpt |
---|
| _action_save |
---|
| _action_save |
---|
nopanel | true |
---|
|
Action's Properties, toggle on Insert excerpt |
---|
| _toggle_on |
---|
| _toggle_on |
---|
nopanel | true |
---|
|
Auto Save Attributes - Select
Insert excerpt |
---|
| _finish |
---|
| _finish |
---|
nopanel | true |
---|
|
- Hover over the
Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
action and select out - When the red arrow shows, click on the
Insert excerpt |
---|
| _action_save |
---|
| _action_save |
---|
nopanel | true |
---|
|
Courses action node - On the Mappings window:
- Drag the NewCourseStatus attribute from the left onto the CourseStatus attribute on the right
- Drag the CourseID attribute from the left onto the CourseID attribute on the right
Select Save
Expand |
---|
|
|
- Close the Actionflow and return to the Teacher Management screen
- the screen and select a record to Edit
- On the Teacher Form, change the teacher's Status to Inactive and press Save
- To see that the Actionflow has worked, open the Course Management screen
- Any course(s) assigned to the teacher you just updated should have a Status of On Hold