Versions Compared

Key

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

Insert excerpt
_Banners
_Banners
nameactionflow
nopaneltrue

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
nopaneltrue
 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 


Expand
titleViews vs Lookups

Insert excerpt
1.15 View Action Configuration
1.15 View Action Configuration
nameLookupVsView
nopaneltrue

Creating Lookups

  1. Hover over an Action node, e.g. a Calculate Action, on the canvas and select 
  2. Enter a name for the Lookup Connector
  3. Click onto a 
    Insert excerpt
    _action_view
    _action_view
    nopaneltrue
     
    Action on the canvas
  4. Alternatively, click onto any empty space on the canvas to create a new 
    Insert excerpt
    _action_view
    _action_view
    nopaneltrue
     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
nopaneltrue
 to find the string form field, StudentIDFromAttendees and unhide it using the 
Insert excerpt
_property_tabs
_property_tabs
namestyle
nopaneltrue
.

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
nopaneltrue
 Action and a 
Insert excerpt
_action_view
_action_view
nopaneltrue
 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

  1. Add a custom button from the palette to the Tile - Footer area beneath the School Courses grid
    1. Name: Enrolled Students
  2. Right-click on the button and choose 
    Insert excerpt
    _actionflow_add
    _actionflow_add
    nopaneltrue
  3. Enter a name for the Actionflow,
    1. Name: Find Students
    2. Select Confirm
  4. Select Click to Connect and for the input, choose the School Course 
    Insert excerpt
    _grid
    _grid
    nopaneltrue
     data source, then select Connect Input
  5. In the Mappings window that opens, drag the CourseID attribute from the left to the right
    1. Select Save
  6. Click and drag the 
    Insert excerpt
    _action_calculate
    _action_calculate
    nopaneltrue
     icon from the toolbar onto the canvas
  7. In the Create Calculate Action window enter:
    1. Name: FindStudents
    2. 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.


  8. Click and drag the 
    Insert excerpt
    _driving_interface_connection_point
    _driving_interface_connection_point
    nameicon
    nopaneltrue
     icon onto the 
    Insert excerpt
    _action_calculate
    _action_calculate
    nopaneltrue
     action node
  9. Right-click on the in connector and choose
    Insert excerpt
    _open_mappings
    _open_mappings
    nopaneltrue
    1. Drag the CourseID attribute on the left onto the Drag and Drop area on the right
    2. Select Save
  10. To lookup to the Course Attendees table, we need to create a 
    Insert excerpt
    _action_view
    _action_view
    nopaneltrue
     Action
  11. Click and drag the 
    Insert excerpt
    _action_view
    _action_view
    nopaneltrue
     icon from the toolbar onto the canvas
  12. In the Create View Action window enter:
    1. Name: GetStudentID
    2. Primary Table: choose Course Attendees
    3. Select Create Action

Expand
titleCheckpoint

Configure the Lookup on the View Action 

  1. Hover over the
    Insert excerpt
    _action_calculate
    _action_calculate
    nopaneltrue
     Action and select 
  2. Enter a name for the Lookup Connector:
    1. Name: lu
    2. Select Confirm
    3. When the red arrow shows, click on the 
      Insert excerpt
      _action_view
      _action_view
      nopaneltrue
      Action on the canvas
  3. Select the 
    Insert excerpt
    _action_view
    _action_view
    nopaneltrue
    Action on the canvas to open its
    Insert excerpt
    _property_settings
    _property_settings
    nopaneltrue
  4. In the Output Attributes section, click on the 
    Insert excerpt
    _attributes_icon
    _attributes_icon
    nopaneltrue
     icon 
    1. In the Available Attributes window, drag StudentID into the Output Attributes section of the 
      Insert excerpt
      _property_settings
      _property_settings
      nopaneltrue
    2. Click OK
  5. Select the lu connector to map the incoming and outgoing data
  6. For the Incoming Mappings:
    1. 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
      nopaneltrue
       Action
    2. Select Next
  7. For the Outgoing Mappings:
    1. 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
      nopaneltrue
       Action
    2. Right-click on the StudentID attribute you just created and rename it
    3. Click Confirm
  8. We need to filter the data coming out of the lookup 
  9. Click on the
    Insert excerpt
    _action_view
    _action_view
    nopaneltrue
     Action to open its Properties
  10. In the Data Retrieval Options section, click the 
    Insert excerpt
    _addIcon
    _addIcon
    nopaneltrue
     icon next to Filter
    1. Name: ByCourseID
    2. Filter Details: 
    3. Insert excerpt
      _finish
      _finish
      nopaneltrue
       the Filter tab
  11. Insert excerpt
    _save
    _save
    nopaneltrue
     the View Action tab
Expand
titleCheckpoint

Configure the Calculate Action and Output

  1. Click on the
    Insert excerpt
    _action_calculate
    _action_calculate
    nopaneltrue
     Action on the canvas to open its Properties
  2. In the Output Attributes section, click the 
    Insert excerpt
    _addIcon
    _addIcon
    nopaneltrue
     icon to create a new attribute:
    1. Name: CourseStudentIDs
    2. Type: Choose Structured Data 
      1. This will return the results as an array
    3. Expression: 

      Code Block
      languagejs
      themeEmacs
      lu.StudentIDFound


    4. Click 

      Insert excerpt
      _finish
      _finish
      nopaneltrue

  3. Under Connections, select 
    Insert excerpt
    _addIcon
    _addIcon
    nopaneltrue
     Add
  4. Add an Output Connection Point:
    1. Name: out
    2. Click Create Connection Point
  5. Select Click to Connect and choose the 
    Insert excerpt
    _form
    _form
    nopaneltrue
     data source, then Connect Output
    1. Close the Mappings window that opens
  6. Hover your mouse over the Calculate Action on the canvas and click out
  7. When the red arrow shows, click on the 
    Insert excerpt
    _output
    _output
    nameicon
    nopaneltrue
     node under Connections
  8. 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
    1. Click Save
  9. Click the out connection point, under Connections
  10. On the Mappings window, drag the CourseStudentIDs output attribute from the output to the string field, StudentIDFromAttendees
    1. Click Save
  11. 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.

  1. Return to the screen containing the School Courses grid
  2. Right-click on the Students grid and choose 

    Insert excerpt
    _view_show_config
    _view_show_config
    nopaneltrue
  3. In the Data Retrieval Options, next to Background Filter, click 
    Insert excerpt
    _addIcon
    _addIcon
    nopaneltrue
    1. Name: ByStudentID
    2. Filter Details: 
    3. Click 
      Insert excerpt
      _finish
      _finish
      nopaneltrue
  4. Insert excerpt
    _lock
    _lock
    nopaneltrue
     the screen and press the Enrolled Students button to see the Actionflow working



Image Modified