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 the View Action to filter the results
- Outgoing Mappings: the attributes being passed out of the View Action via the lookup connector
Expand |
---|
|
Insert excerpt |
---|
| 1.15 View Action Configuration |
---|
| 1.15 View Action Configuration |
---|
name | LookupVsView |
---|
nopanel | true |
---|
|
|
Creating Lookups
Iframe |
---|
allowfullscreen | true |
---|
src | https://www.youtube.com/embed/2gwSPS8exxA?si=o14CBebFWw42bSIG?&rel=0&ytp-pause-overlay |
---|
width | 680 |
---|
align | middle |
---|
height | 400 |
---|
|
- 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 are using:
- A Course Classroom Management screen containing - this screen was created using the Tile with Buttons template, and contains:
- A grid basic card container of the School Courses Classroom data
- A contacts basic card container of the School Students Courses data
- An empty string field, StudentIDFromAttendees FilterField
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 working on the expandable tile on the Course Classroom Management screen. |
Lookup to
Retrieve DataWe 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 Student IDs of the students attending a course. The Actionflow will output the Student IDs from the Attendees data to a string field, where we will set up a background filter that uses the string field to filter a contacts card container of Students to show only those attending the course.
Image RemovedClassroom Courses
In this example, we want to see the courses held in each classroom when each classroom is clicked. To do this, we will use the classroom data to lookup and retrieve the associated courses data, then output that data back to the screen where it can be used to filter the courses data.
Image Added
To do this it we will:
- Lookup the courses using the Course Classroom ID, which is found on both the Classroom and 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 tables
- Write those courses' Course ID(s) back to the screen onto a string field
- Setup a background filter to only show students courses in a Students contacts card Courses card container that match the Student Course ID in the field
Screen Setup
Insert excerpt |
---|
_lock | _lock | nopanel | true |
your screen to expand the Students contacts card container on the right, shown by the tile with chevronEvent Handler Setup
Event handlers facilitate actions occurring in response to a user action. For this example, we want a user clicking on a classroom card to run an Actionflow that populates a string field that we will later to use to filter the information that can be seen on screen
- Click on the top card on the Classroom Management screen to open the
Insert excerpt |
---|
| _unlockproperty_settings |
---|
| _property_unlocksettings |
---|
nopanel | true |
---|
|
your screen and click for the area, Card - Click on the
Insert excerpt |
---|
| _property_palettetabs |
---|
| _paletteproperty_tabs |
---|
name | action |
---|
nopanel | true |
---|
|
in the toolbar to open the Serene Grey palette - Expand Buttons - Secondary and add a custom button to the Tile - Footer area beneath the School Courses grid
- Name:
Enrolled Students
- Using Click the layerslayers, hold down shift to move the button into the area, Right
Image Removed
Create Calculate Action and View Action
- Right-click on the Enrolled Students button and choose icon in the Event Handler section
- In the New Card (On Click) Event Handler tab, click actionflow_addactionflow_add
- Enter a name for the Actionflow:
- Name:
Find Students
Select Confirm-
Filter Courses
Image Added
Create Calculate Action and Lookup
- Select Click to Connect and for the input, choose the School Course
Insert excerpt |
---|
_grid | _grid | nopanel | true |
View ComponentClassrooms Card Component, then select Connect InputInput - In the Mappings window that opens, drag the CourseID ClassroomID 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
GetCourses
Select Create Action
Note |
---|
For the input data, the attributes pass through the Calculate action without being processed. For the output data, the Calculate action processes the data into an array. |
- 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 ClassroomID attribute on the left onto the Drag and Drop area on the right
- Select Save
- To look up to the Course Attendees School_Courses table, we need to create a hover over the
Insert excerpt |
---|
| _action_viewcalculate |
---|
| _action_viewcalculate |
---|
nopanel | true |
---|
|
ActionClick and drag the Insert excerpt |
---|
_action_view | _action_view | nopanel | true |
icon from the toolbar onto action node and choose, Add Lookup- On the Add Connection Point window, name the lookup:
luc
- We recommend choosing a name to indicate the action taking place, e.g. "luc" for look up courses
- Click Confirm
- With the red arrow attached to your mouse, click anywhere on the canvas
- In the Create View Action window enter:
- Name:
GetStudentID
Courses
- Primary Table: choose Course Attendees School_Course
Select Create Action
Expand |
---|
|
Image Removed |
Lookup on the View Action Hover over the Insert excerpt |
---|
_action_calculate | _action_calculate | nopanel | true |
Action and select Image RemovedEnter a name for the Lookup Connector:Name: lu
Select ConfirmWhen the red arrow shows, click on the Insert excerpt |
---|
_action_view | _action_view | nopanel | true |
action on the canvasSelect 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 OKSelect the lu connector to map the incoming and outgoing dataFor the Incoming Mappings:Drag the CourseID - The Output Attribute Selection window will open automatically
- Click the tick box next to CourseID
- Click Next
- The Incoming Mappings window will open automatically
- Drag the ClassroomID 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 The Outgoing Mappings :window will open automatically
- Drag the StudentID CourseID attribute from the left (View Action) to the Drag and Drop area on the right to map a corresponding attribute back to the
Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
action- Image Removed
Right-click on the StudentID attribute you just created and select Insert excerpt |
---|
_edit | _edit | nopanel | true |
- Rename the attribute:
StudentIDFound
- Image Removed
- Click Confirm
- Image Added
- Click Confirm and Create Filter
- 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 PropertiesIn the Data Retrieval Options section, click the
Insert excerpt |
---|
_addIcon | _addIcon | nopanel | true |
icon next to Filter- Name:
ByCourseID
- Filter Details: Image RemovedName:
ByClassroomID
- Click abc to tell PhixFlow to interpret the field as an expression
Insert excerpt |
---|
_finish | _finish | nopaneltrue | the Filter tab
Insert excerpt |
---|
_save | _save | nopanel | true |
the View Action tab- Filter Conditions: Image Added
- In this filter, the top CourseID is from the Courses data, and the bottom CourseID is from the Classroom data
- Select Finish
Expand |
---|
|
Image RemovedImage Added |
- Click on the
Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
action on the canvas to open its Insert excerpt |
---|
| _property_tabs |
---|
| _property_tabs |
---|
nopanel | true |
---|
|
- In the Output Attributes section, click the
Insert excerpt |
---|
| _addIcon |
---|
| _addIcon |
---|
nopanel | true |
---|
|
icon to create a new attribute:- Name:
CourseStudentIDs
CourseIDArray
- Type: Choose
Structured DataData
This will return the results as an array
- Expression:
Code Block |
---|
|
luluc.StudentIDFoundCourseID |
Click
Insert excerpt |
---|
| _finish |
---|
| _finish |
---|
nopanel | true |
---|
|
Under Connections on the left, select
Insert excerpt |
---|
| _addIcon |
---|
| _addIcon |
---|
nopanel | true |
---|
|
AddAdd an Output Connection Point:
- Name:
out
output
Type: choose Output
- Click Create Connection Point
- Select Click to Connect and In the Connect Output window, choose the CourseManagement ClassroomAvailabilityManagement , then Connect Output
- Close the Mappings window that opens as we don't have any attributes to map to this yet
- Hover your mouse over the
Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
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 - CourseIDArray attribute from the Calculate action into the Drag and Drop area on the right to create a corresponding attribute
in - on the output
- Click Save
- Click the out output connection point, under Connections
- On the Mappings window, drag the
CourseStudentIDs output attribute - CourseIDArray attribute from the output to the string field,
StudentIDFromAttendees- FilterField
- Click Save
- The Actionflow is now built
Expand |
---|
|
Image RemovedImage Added |
Setup Setting up a Background Filter
The Event Handler and Actionflow will now populate the string field, StudentIDFromAttendees FilterField, by clicking each classroom card, but the Courses card container needs a background filter setting so it can be filtered by the values in this field need to be linked to the Students contact cards using a background filter in order to only see the students for the selected course onlythe string field.
Expand |
---|
|
Anchor |
---|
| troubleshooting |
---|
| troubleshooting |
---|
|
Note |
---|
If at any point your screen does not display the expected results, such as clicking on the classroom card does not populate FilterField, or after creating the below filter the Courses cards do not filter, always try closing and reopening the screen first. |
|
- Return to the Course Classroom Management screen
Click on the Students contact card Courses card container to open the Card Component
Insert excerpt |
---|
| _property_settings |
---|
| _property_settings |
---|
nopanel | true |
---|
|
- Ensure you click on the white space underneath the top contact card to open the Card Component
On the
Insert excerpt |
---|
| _property_tabs |
---|
| _property_tabs |
---|
nopanel | true |
---|
|
, in the Background Filter Rules section, click Insert excerpt |
---|
| _addIcon |
---|
| _addIcon |
---|
nopanel | true |
---|
|
- Enter the Rule Expression:
true
- Create a new filter by pressing
Insert excerpt |
---|
| _addIcon |
---|
| _addIcon |
---|
nopanel | true |
---|
|
next to Filter:- Name:
ByStudentID
ByFilterField
- In the Filter Details section, click Select an option and choose the CourseID in the Table Attributes
- Filter Details: Image Removed Image Added
- Click
Insert excerpt |
---|
| _finish |
---|
| _finish |
---|
nopanel | true |
---|
|
on both the Filter and Filter Rule Insert excerpt |
---|
| _property_settings |
---|
| _property_settings |
---|
nopanel | true |
---|
|
- the screen and press the Enrolled Students button click a classroom card to see the Actionflow working
Having trouble? See Troubleshooting above.
Tip |
---|
Once you have verified the Actionflow is working, the StudentIDFromAttendees FilterField string field can be hidden in the Insert excerpt |
---|
| _property_tabs |
---|
| _property_tabs |
---|
name | style |
---|
nopanel | true |
---|
| or Insert excerpt |
---|
| _layers |
---|
| _layers |
---|
nopanel | true |
---|
| to tidy up the screen. |