What is a Lookup?
Lookups are denoted by a dotted double-ended connector transferring data into and out of a Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
Action, and are used to lookup and retrieve records in other recordsets. Lookup views require:
- Incoming Mappings: the attributes being passed into the View Action via the lookup connector
- Output Attributes: the attributes being used by View Action to filter results
- Outgoing Mappings: the attributes being passed out of the View Action via the lookup connector
Insert excerpt |
---|
| 1.15 View Action Configuration |
---|
| 1.15 View Action Configuration |
---|
name | LookupVsView |
---|
nopanel | true |
---|
|
Creating Lookups
- Hover over an Action node, e.g. a Calculate Action, on the canvas and select
- Enter a name for the Lookup Connector
- Click onto a
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
Action on the canvas - Alternatively, click onto any empty space on the canvas to create a new
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
Action
Worked Example
Here's a worked example using the School Data (available from the Learning Centre).
In this example, we will configure an Actionflow that retrieves the Student IDs of students attending a course, and outputs these to a string field. We will set up a background filter that uses the string field to filter a grid of Students. GIF
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. Use the Insert excerpt |
---|
| _layers |
---|
| _layers |
---|
nopanel | true |
---|
| to find the string form field, StudentIDFromAttendees and unhide it using the Insert excerpt |
---|
| _property_tabs |
---|
| _property_tabs |
---|
name | style |
---|
nopanel | true |
---|
| . |
In this example, we are using a Course Management screen - the screen was created using the Tile with Buttons template, and contains:
- a grid of the School Courses data
- a grid of the School Students data
- a string field
Lookup to Retrieve Data
We will create an Actionflow containing a
Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
Action and a
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
Action. The Calculate Action will allow the input data to pass through into the View Action, where it will be used to lookup to the Course Attendees table to find the students attending the courses.
To do this it we will:
- Lookup using the Course ID, which is found on both the Course and Attendees tables
- Use the Course ID on the Attendees table to find the corresponding Student ID(s) of the student(s) attending that course
- Write those Student ID(s) back to the screen onto a field
- Setup a background filter to only show students in a Students grid that match the Student ID in the field
Create Calculate Action and View Action
- Add a custom button from the palette to the Tile - Footer area beneath the School Courses grid
- Name:
Enrolled Students
- Right-click on the button and choose
Insert excerpt |
---|
| _actionflow_add |
---|
| _actionflow_add |
---|
nopanel | true |
---|
|
- Enter a name for the Actionflow,
- Name:
Find Students
- Select Confirm
- Select Click to Connect and for the input, choose the School Course data source, then select Connect Input
- In the Mappings window that opens, drag the CourseID attribute from the left to the right
- Select Save
- Click and drag the
Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
icon from the toolbar onto the canvas - In the Create Calculate Action window enter:
- Name:
FindStudents
Select Create Action
Note |
---|
The Calculate Action will be configured below as it is needed for the output. For the input data, the attributes pass through without being processed. |
- Click and drag the
Insert excerpt |
---|
| _driving_interface_connection_point |
---|
| _driving_interface_connection_point |
---|
name | icon |
---|
nopanel | true |
---|
|
icon onto the Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
action node - Right-click on the in connector and choose
Insert excerpt |
---|
| _open_mappings |
---|
| _open_mappings |
---|
nopanel | true |
---|
|
- Drag the CourseID attribute on the left onto the Drag and Drop area on the right
- Select Save
- To lookup to the Course Attendees table, we need to create a
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
Action - Click and drag the
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
icon from the toolbar onto the canvas - In the Create View Action window enter:
- Name:
GetStudentID
- Primary Table: choose
Course Attendees
Select Create Action
Expand |
---|
|
|
- Hover over the
Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
Action and select - Enter a name for the Lookup Connector:
- Name:
lu
- Select Confirm
- When the red arrow shows, click on the
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
Action on the canvas
- Select the
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
Action on the canvas to open its Insert excerpt |
---|
| _property_settings |
---|
| _property_settings |
---|
nopanel | true |
---|
|
- In the Output Attributes section, click on the
Insert excerpt |
---|
| _attributes_icon |
---|
| _attributes_icon |
---|
nopanel | true |
---|
|
icon - In the Available Attributes window, drag StudentID into the Output Attributes section of the
Insert excerpt |
---|
| _property_settings |
---|
| _property_settings |
---|
nopanel | true |
---|
|
- Click OK
- Select the lu connector to map the incoming and outgoing data
- For the Incoming Mappings:
- Drag the CourseID attribute from the left (Calculate Action) into the Drag and Drop area on the right to create a corresponding attribute in the
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
Action - Select Next
- For the Outgoing Mappings:
- Drag the StudentID attribute from the left (View Action) to the Drag and Drop area on the right to create a corresponding attribute back to the
Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
Action - Right-click on the StudentID attribute you just created and rename it
- Click Confirm
- We need to filter the data coming out of the lookup
- Click on the
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
Action to open its Properties - In the Data Retrieval Options section, click the
Insert excerpt |
---|
| _addIcon |
---|
| _addIcon |
---|
nopanel | true |
---|
|
icon next to Filter- Name:
ByCourseID
- Filter Details:
Insert excerpt |
---|
| _finish |
---|
| _finish |
---|
nopanel | true |
---|
|
the Filter tab
- the View Action tab
Expand |
---|
|
|
- Click on the
Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
Action on the canvas to open its Properties - In the Output Attributes section, click the
Insert excerpt |
---|
| _addIcon |
---|
| _addIcon |
---|
nopanel | true |
---|
|
icon to create a new attribute:- Name:
CourseStudentIDs
- Type: Choose
Structured Data
- This will return the results as an array
Expression:
Code Block |
---|
|
lu.StudentIDFound |
Click
Insert excerpt |
---|
| _finish |
---|
| _finish |
---|
nopanel | true |
---|
|
- Under Connections, select
Insert excerpt |
---|
| _addIcon |
---|
| _addIcon |
---|
nopanel | true |
---|
|
Add - Add an Output Connection Point:
- Name:
out
- Click Create Connection Point
- Select Click to Connect and choose the data source, then Connect Output
- Close the Mappings window that opens
- Hover your mouse over the Calculate Action on the canvas and click out
- When the red arrow shows, click on the
Insert excerpt |
---|
| _output |
---|
| _output |
---|
name | icon |
---|
nopanel | true |
---|
|
node under Connections - On the Mappings window, drag across the CourseStudentIDs output attribute from the Calculate Action into the Drag and Drop area on the right to create a corresponding attribute in the output
- Click Save
- Click the out connection point, under Connections
- On the Mappings window, drag the CourseStudentIDs output attribute from the output to the string field, StudentIDFromAttendees
- Click Save
- The Actionflow is now built
Setup Background Filter
The Actionflow will populate the string field, StudentIDFromAttendee, but the values in this field need to be linked to the Students grid using a background filter in order to only see the students for the selected course.
- Return to the screen containing the School Courses grid
Right-click on the Students grid and choose
Insert excerpt |
---|
| _view_show_config |
---|
| _view_show_config |
---|
nopanel | true |
---|
|
- In the Data Retrieval Options, next to Background Filter, click
Insert excerpt |
---|
| _addIcon |
---|
| _addIcon |
---|
nopanel | true |
---|
|
- Name:
ByStudentID
- Filter Details:
- Click
Insert excerpt |
---|
| _finish |
---|
| _finish |
---|
nopanel | true |
---|
|
- the screen and press the Enrolled Students button to see the Actionflow working