Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Overview

Using lookups in Actionflows allows users to return multiple records as an array and has many applications. This page covers the following:

Lookup connections

Lookup connections are represented by dotted lines in an actionflow. When called, they pass blocks of data as a single dataset (array) instead of passing each record one-by-one through the connection. Imagine a screen contains the following grid:

UIDObjectColour
1001TableWhite
1002ChairBlack
1003ComputerSilver

Actionflows can lookup to this data and retrieve all the records displayed on the grid. This will then return all 3 records as an array in the format:

[
	[1001, 'Table', 'White'],
	[1002, 'Chair', 'Black'],
	[1003, 'Computer', 'Silver']
]

If the grid was wired into the actionflow using a driving connection, each record would pass into the actionflow one-by-one, and the actionflow would run 3 times.

Worked examples

See some worked examples below to see how lookups can be used effectively in an actionflow.

Counting selected records

A user creates the above grid on a screen: 

The user wants to create a button that counts the number of records that have been selected on the grid and display this in a form field. To do this:

  1. Drag and drop a button from the palette onto the button bar
  2. Name this Count Records
  3. Drag and drop a String Form Field onto the tile
  4. Name this RecordCount

  5. Right click on the button and select Add actionflow
  6. Name the actionflow Count Records
  7. Click Connect on the connections pane and select the Event input

    All actionflows require an input to run. The event input must be connected as this will run the actionflow once to lookup the number of selected records.

  8. Click Add on the connections pane

    1. Name the connection CountRecords

    2. Select Lookup

    3. Click Create Connection Point

    4. Select the Objects grid

    5. Click Connect Input
  9. On the mappings screen that appears drag the UID across to create a mapping.
    1. Make sure the data being used is set to Selected Records.
    2. Click Confirm Mappings
  10. Create a Calculate Node by dragging and dropping from the toolbar
    1. Name the node Count Records
  11. Connect the Event Input to the calculate. This is what causes the actionflow to run.
  12. Connect the Grid Lookup to the calculate
    1. Select Add Lookup
    2. Name the connection lu
    3. Drag and drop the UID field to create a mapping to the calculate.
    4. Click Confirm Mappings
  13. Click on the Calculate node to open its editor.
    1. Add a calculate attribute:
      Name: Count
      Type: String
      Order: 1
      Expression:

      countElements(lu.UID) + " records"
    2. Save the attribute

Now we need to return the value back to the screen. To do this:

  1. Click Add on the connections pane

    1. Name the connection return

    2. Select Output

    3. Click Create Connection Point

    4. Select the Objects form

    5. Click Connect Output
  2. Connect the calculate to the return output of the actionflow
    1. Hover over the calculate node
    2. Select Out
    3. Drop the arrow onto the return output to create the connection.
  3. Right click on the connection between the calculate and return connection point and select Configure mappings
    1. Drag and drop the Count attribute from the calculate node to the return connection point.
  4. Right click on on the connection between the return connection point and the Objects form.
    1. Drag and drop the Count attribute onto the RecordCount string field to create a mapping.

The actionflow is now configured. Select records on the screen and try out the action.

Checking for duplicates


Checking a value is in a list


Advanced Searching



  • No labels