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.
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 |
---|
|
|
Worked Example
Here's a worked example using the School Data (available from the Learning Centre).
In this example we will configure an Actionflow to change the Status of a Course when a Teacher's Status is changed, i.e. changing a Teacher's Status to Inactive causes a Course's Status to change to On Hold. 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 using the Teacher Management, Course Management and Teachers Form screens. |
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, 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
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.
Setup the Create a View Action to access the School Courses data within an Actionflow for the School Teachers data.
- Open the Save Actionflow for the Teachers Form
- Click on the input connection point, under Connections, to open the Connector Mappings
Insert excerpt |
---|
| _action_connector_mappings |
---|
| _action_connector_mappings |
---|
nopanel | true |
---|
|
- Drag the TeacherStatus attribute from the left to the Drag and Drop area on the right
- Click Save
- Drag a View Action
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 View action the
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
Action you just created onto the in connector between the input node and the Save action Node and the Insert excerpt |
---|
| _action_save |
---|
| _action_save |
---|
nopanel | true |
---|
|
Action - Click on the in connector between the input node and the View node 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 to the Drag the Drag and Drop area on the right
- Select Save
- Click on the View Action to open the propertiesIn the Output Attributres sectionthe
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 properties
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 properties
Setup the Insert excerpt |
---|
| _property_settings |
---|
| _property_settings |
---|
nopanel | true |
---|
|
Create a Calculate Action to alter the CourseStatus data based on the TeacherStatus data.
- Drag a View Action a
Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
Action from the toolbar onto the canvas- Name: Change
Change Course Status
- Select Create Action
- Drag and drop the Calculate action you the
Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
Action you just created onto the in connector between the View action node and the Save action nodethe 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 View action node and the Calculate action nodethe
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 Calculate action
Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
Action- Select Save
- Click on the Calculate action to open its propertiesIn the output attribute 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 output 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 |
---|
|
|
Setup As we are modifying the Save Actionflow for the Teachers table, we need an additional Save action
Insert excerpt |
---|
| _action_save |
---|
| _action_save |
---|
nopanel | true |
---|
|
Action to save the NewCourseStatus to the Courses table.
- Drag a Save Action
Insert excerpt |
---|
| _action_save |
---|
| _action_save |
---|
nopanel | true |
---|
|
Action from the toolbar onto the canvas- Name:
Save Courses
- Table: Choose
School Courses table
- Select Create Action
- In the Save Action's properties, toggle on 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 - Hover over the calculate action the
Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
Action and select out - When the red arrow shows, click on the Save Courses action 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 the CourseID attribute on the right
- Select Save
- 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