Insert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
Overview
Actionflows can be used to pass data 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
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.
see Understanding Actionflows.
Step 1 Create the Actionflow
- 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 Find Screen 2 in the repository and dragging it onto Screen the screen 1 , canvas. PhixFlow automatically creates a button and with an actionflow that opens Screen 2.
- Open the actionflow by right-clicking the button on Screen 1 and selecting Display Actionflow. Edit the ActionflowClick screen 2; see Adding a Button to Open a Screen.
- Right-click on the new button and select Display Actionflow to open the actionflow diagram.
Step 2 Configure the Actionflow
In the actionflow diagram, in the Inputs panel, click on the On-Click Event
,and select the
datasource that hassource of your data.
For exampleScreen 1 form
.The mapping screen will open.Note this can be accessed later by right-clickingPhixFlow opens the Mappings window.
datasourceTip If you need to change the mapping later, to reopen the Mappings window, right-click on the line between the
and clickingsource of data and the connection point,
then click.
.Insert excerpt _mapping _mapping nopanel true - Drag the required attributes you wish want to pass to the next screen In our example we will send the
Company Name
- The following illustrates these steps:
- Right-click on the connector, screen, connected to your Screen 2 and select Remove Connector.
- In the example above, the connector called screen only opens the screen. In this case we need to pass data. Therefore This means we will connect to the form in the next steps.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. - Connect the Inputs → in connection point to Open (Screen 2). This time we will select the Form as this allows us to pass dataIn the popup, select Form, which allows data to pass. When prompted select Screen 2.
- In the mapping screen which opens Mapping window, map the required attributes you wish want to pass to Screen 2. For this example, we will send the pass on
Company Name
.The following illustrates these steps: - Close the actionflow.Testing
Connecting using screen, only opens the screen, from the left to the right box.
In the example screenshots, we will pass on the
Company Name
.Step 3 Test the
setupEnsure you haveScreen 1
open and switch PhixFlow into Application mode. See configuration
- Open the screen 1 canvas and switch to
; see Design and Application Mode if you require assistance.Insert excerpt _app_mode _app_mode nopanel true - Click your button and now when
Screen 2
opens theCompany Name
is passed from Screen 1 to Screen 2, along with any In screen 1, edit aCompany Name
and click the button.
Screen 2 opens with the data for theCompany Name
attribute including the latest edits.
Passing a Calculate 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.
Step 1 Update Screen 2
- Open Screen 2 and add a form field from the palette that will be used to hold the calculated value we pass across. In our example this is called,
CalculatedValue.
- Close the screen.
We now need to tell the actinflow about this change
- Open Screen 1, unlock it if necessary, right-click on the button that opens Screen 2 and select Display Actionflow.
- Open the Screen 2 node from the actionflow, from the Input Connection Points open the component where the data will be displayed by double-clicking on it. In our example this is Screen 2.
- In the window that opens, in the Attributes section, click
and from the screen that opens drag the newInsert excerpt _attributes _attributes nopanel true CalculateValue
filed into this attribute section.
Update
Step 1 Update the Actionflow
- From the context toolbar drag a
onto the canvas. Provide a useful name. In our example this is calledInsert excerpt _actionflow_calculate _actionflow_calculate nopanel true CalculateValue
.- In here you can perform any calculation see Calculate Node. Save your changes.
- Remove the connection between in and Screen 2.
- Connect the in connection point to the
.Insert excerpt _actionflow_calculate _actionflow_calculate nopanel true - Connect
CalculateValue
to Screen 2 using the Screen 2 form.
Updating Values on an Existing Screen
PhixFlow can update the values on a screen, for example a user enters a date and needs to calculate the number of working days to that date.
- Add a button to your screen.
- See Designing Screens.
- Right-click on the button, select
.Insert excerpt _actionflow_add _actionflow_add nopanel true - Create you actionflow to perform the required functionality, for example calculate the number of working days until a selected date. See Understanding Actionflows for assistance.
- In the connection points click
:Insert excerpt _Add _Add nopanel true - Provide a meaningful Name.
- Select Output.
- In the screen that opens select the form you wish to write the data back to. Note you can only write back to a form field, you cannot write back to any other view type.
- Map your outgoing attributes to the available attributes. See Wiring Actionflows.
When the actionflow runs it will output the value from the actionflow to your original screen.