Insert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
Overview
Actionflows can be used This page is for application designers who want to pass data changes between screens, itMoving data between screens is achieved through an ActionFlow and form fields on a screen. In this example, we have a Company Name form field on Screen 1 that we will pass to Screen 2 using an actionflow. This is illustrated below:
Passing Data 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.
Note |
---|
When passing data between screens: only a single record can be sent from one screen to another, and it can only be passed to a form. |
This setup assumes Screen 1 has Company Data already displayed on it. Example company data is available from the Learning Centre. See Designing Screens for guidance on setting up screens.
- Open Screen 1 and add a button with an actionflow that opens Screen 2. See Understanding Actionflows.
- A shortcut for doing this is to find Screen 2 in the repository and dragging it onto Screen 1, PhixFlow automatically creates a button and actionflow that opens Screen 2.
- Open the actionflow by right-clicking the button on Screen 1 and selecting Display Actionflow.
Screen 1 form
.Company Name
- Connecting using screen, only opens the screen, we need to pass data. Therefore we will connect to the form in the next steps.
|
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:
Tip |
---|
You can download the example data from the PhixFlow Learning Centre. |
See the 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 Actionflows.
Step 1 Create the actionflow
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.
Note This actionflow only opens the new screen. You need to make changes to the actionflow so that the data is passed to Screen2.
- In the Screen1 canvas, right-click on the new button and select Display Actionflow to open the actionflow diagram.
Step 2 Configure the actionflow
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.
- 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 dragCompany Name
to the right box, which lists attributes available to Screen2. - 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.
- To remove the connector, in the actionflow, right-click on the connector to screen 2 and select Remove Connector, then Confirm the removal.
- Reconnect the Inputs → in connection point to Open (Screen 2). This time we will select the Form as this allows us to pass data, PhixFlow opens a popup menu. Select Form, which allows data to pass. When prompted, select Screen 2.
- In the mapping screen which opens, map the required Mapping window, remap the attributes you wish want to pass to Screen 2. For this example we will send the
Company Name
.The following illustrates these steps:Screen2.
- Close the actionflow.Testing the setup
Tip |
---|
Screen 1
open and switch PhixFlow into Application mode. See Design and Application Mode if you require assistance.Screen 2
opens the Company Name
is passed from Screen 1 to Screen 2, along with any edits.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
|
Step 3 Test the actionflow configuration
- Open the Screen1 canvas and switch to
; see Design and Application Mode.Insert excerpt _app_mode _app_mode nopanel true - In Screen1, edit the data in the
Company Name
field and click the button. - The application opens Screen2. The
Company Name
field should display your changes.
Passing a Calculated Value to Another Screen
Anchor | ||||
---|---|---|---|---|
|
This example builds on the example above. we will now insert a calculated value into the actionflow created above to add a value that then gets passed to a second screen.
Update Screen 2Open Screen 2 and addWhen 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
- Open Screen2.
- Add a form field from the palette that will be used to
This field will hold the calculated value we want to pass acrossto Screen2.
In our the example this is called, calledCalculatedValue
. - Close the screenScreen2.
- We now need to tell the actinflow about this change Open Screen 1,
Step 2 Update the actionflow
- Open Screen1 and unlock it if necessary, right
- Right-click on the button that opens Screen 2 Screen2 and select Display Actionflow.
- Open In the Screen 2 node from the actionflow, from the click on the Screen2 node to open its properties.
- In
→ Input Connection Points open section, double-click the component where the data will be displayed by double-clicking on it. to open its connection point properties.Insert excerpt _property_tabs _property_tabs name basic nopanel true
In our example this is Screen 2Screen2. - In the window that opens, in the Attributes sectionconnection point properties →
→ Attributes section toolbar, clickInsert excerpt _property_tabs _property_tabs name basic nopanel true
and from the screen that opens drag .Insert excerpt _attributes _attributes nopanel true - PhixFlow opens the list of attributes that are available. Drag the new
CalculateValue
filed into this attribute section attribute into the Attributes section, as shown below.
Update
Step 3 Calculate the
Actionflowvalue
- From the context actionflow toolbar, drag a
onto the canvas. Provide a useful name. This type of node can perform calculations; see Calculate Node Properties.Insert excerpt _actionflow_calculate _actionflow_calculate nopanel true - Enter a name for the node and save your changes. In our example this is called
CalculateValue
. - In here you can perform any calculation see Calculate Node. Save your changes.
- Remove the connection between in and Screen 2.
- Connect Reconnect the in connection point to the
.Insert excerpt _actionflow_calculate _actionflow_calculate nopanel true - Connect
CalculateValue
to Screen 2 Screen2 using the Screen 2 Screen2 form.
Updating Values on an Existing Screen
PhixFlow can update the values on a screen, for example a . For example, an application user enters a date and needs wants to calculate the number of working days to that date.
- Add a button to your screen.
- See Designing Screens. Right-click on the button , and select
- Create you an actionflow and add nodes to perform the required functionality, for example calculate the number of working days until a selected date. See Understanding Actionflows for assistance; see Actionflows and Using Actionflow Nodes.
- In the connection points, click
:Insert excerpt _Add _Add nopanel true - Enter a Name.
- Select the Output.
In the
screen that openspopup window, select the form to which you
wishwant to write
thedata
back to. Note you.
backNote You can only write
, youdata to a form field
. You cannot write back to any other view type, such as a grid or card.
- Map your outgoing attributes to the available attributes. See ; see Wiring Actionflows.
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
When the actionflow runs it will output the value from the actionflow to a form field in your original screen.