Passing Data Between Screens

This page is for application designers who want to pass data changes between screens.

Overview

Sometimes an application user will make changes to data fields, and then expect to see those changes reflected on the next screen they use. In this case, use an actionflow to pass data between screens.

When passing data between screens:

  • You have to pass the data from a form field to a form field
  • You can only pass one record.

The examples used on this page assume Screen1 has a form field called Company Name, which displays data. Changes to the Company Name data has to be passed to Screen2, as shown below:

You can download the example data from the PhixFlow Learning Centre.

See the Designing Screens topic for information about creating and designing screens.

Configuring Actionflows to Pass Data

The following instructions assume you know how to set up an actionflow; see Understanding Actionflows.

Step 1  Create the actionflow

  1. Find Screen2 in the repository and drag it onto the Screen1 canvas. PhixFlow automatically creates a button with an actionflow that opens Screen2; see Adding a Button to Open a Screen.

    This actionflow only opens the new screen. You need to make changes to the actionflow so that the data is passed to Screen2.

  2. In the Screen1 canvas, right-click on the new button and select Display Actionflow to open the actionflow diagram.

Step 2  Configure the actionflow

  1. In the actionflow Inputs panel, click on the On-Click event and select the origin of the data. In this example the origin is Screen1. PhixFlow opens the Mappings window.

  2. Drag the attributes you want to pass to the next screen from the left box to the right box.
    In the example shown below, the left box lists the attributes available to Screen1 and we drag Company Name to the right box, which lists attributes available to Screen2.



  3. In the actionflow, PhixFlow creates a connector called screen between in and Screen2 that only opens the screen. In this case we need to pass data. This means we need to remove the connector and create a new one.
  4. To remove the connector, in the actionflow, right-click on the connector to screen 2 and select Remove Connector, then Confirm the removal.
  5. Reconnect the Inputs → in connection point to Open (Screen 2). This time, PhixFlow opens a popup menu. Select Form, which allows data to pass. When prompted, select Screen 2.
  6. In the Mapping window, remap the attributes you want to pass to Screen2. 
     
  7. Close the actionflow.


If you need to change the mapping later, to reopen the Mappings window, right-click on the line between the source of data and the connection point, then click  Add Mapping.

Step 3  Test the actionflow configuration

  1. Open the Screen1 canvas and switch to Application Mode; see Design and Application Mode.
  2. In Screen1, edit the data in the Company Name field and click the button.
  3. The application opens Screen2. The Company Name field should display your changes.

Passing a Calculated Value to Another Screen 

When an application user moves from one screen to another, you may want to provide a new value on the second screen.

The following instructions explain how to calculate a value in the actionflow and then pass it to a screen.

Step 1  Create the form field

  1. Open Screen2.
  2. Add a form field from the palette
    This field will hold the calculated value we want to pass to Screen2.

    In the example this is called CalculatedValue.
  3. Close Screen2.

Step 2  Update the actionflow

  1. Open Screen1 and unlock it if necessary
  2. Right-click on the button that opens Screen2 and select Display Actionflow.
  3. In the actionflow, click on the Screen2 node to open its properties.
  4. In  Properties tab → Input Connection Points section, double-click the component where the data will be displayed to open its connection point properties.
    In our example this is Screen2.


  5. In the connection point properties →  Properties tab → Attributes section toolbar, click  Attributes.
  6. PhixFlow opens the list of attributes that are available. Drag the new CalculateValue attribute into the Attributes section, as shown below.

Step 3 Calculate the value

  1. From the actionflow toolbar, drag a  Calculate onto the canvas. This type of node can perform calculations; see Calculate Node Properties.
  2. Enter a name for the node and save your changes. In our example this is called CalculateValue.
  3. Remove the connection between in and Screen 2.
  4. Reconnect the in connection point to the  Calculate.
  5. Connect CalculateValue to Screen2 using the Screen2 form.

Updating Values on an Existing Screen

PhixFlow can update the values on a screen. For example, an application user enters a date and wants to calculate the number of working days to that date.

  1. Add a button to your screen.
  2. Right-click on the button and select  Add Actionflow.
  3. Create an actionflow and add nodes to perform the required functionality; see Understanding Actionflows and Using Actionflow Nodes.
  4. In the connection points, click  Add New:
    • Enter a Name.
    • Select the Output
  5. In the popup window, select the form to which you want to write data.

    You can only write data to a form field. You cannot write back to any other view type, such as a grid or card.

  6. Map your outgoing attributes to the available attributes; see Wiring Actionflows.

When the actionflow runs it will output the value from the actionflow to a form field in your original screen.