Insert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
Overview
Moving data between screens is achieved through a combination 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
This setup assumes Screen 1 has Company Data already displayed on it. The company data is available from the Learning Centre. See Designing Screens for guidance on setting up screens.
- Create the Actionflow
- Open Screen 1 and add an actionflow that opens Screen 2.
- 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 Screen 1 and selecting Display Actionflow.
- Open Screen 1 and add an actionflow that opens Screen 2.
- Edit the Actionflow
- Click on the On-Click Event, select the datasource that has your data . For example
Screen 1
. - The mapping screen will open.
- Note this can be accessed at a later date by right-click clicking on the line between the datasource and the connection point, and clicking
.Insert excerpt _mapping _mapping nopanel true
- Note this can be accessed at a later date by right-click clicking on the line between the datasource and the connection point, and clicking
- Drag the required attributes you wish to pass to the next screen In our example we will send the
Company Name
. - Right-click on the connector, screen, connected to your Screen 2 and select Remove Connector.
- Connecting using screen, only opens the screen, we need to pass data. Therefore we will connect to the form in the next steps.
- Confirm the removal.
- Connect the in connection point to Open (Screen 2). This time we will select the Form as this allows us to pass data. When prompted select Screen 2.
- In the mapping screen which opens, map the required attributes you wish to pass to screen 2. For this example we will send the
Company Name
. - The following illustrates these steps:
- Close your actionflow
- Click on the On-Click Event, select the datasource that has your data . For example
- Testing the setup
- Ensure you have
Screen 1
open and switch PhixFlow into Application mode. See Design and Application Mode if you require assistance. - Now when
Screen 2
opens theCompany Name
is passed from Screen 1 to Screen 2, along with any edits.
- Ensure you have
Passing a Calculate Value to Another Screen
This example build on the example above. we will no insert a calculated value into the actionflow created above to add a calculated value that then gets passed to a second screen.
- 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.
- 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,
- Update the Actionflow
- Open Screen 1, unlock it if necessary, right-click on the button that opens Screen 2 and select Display Actionflow.
- From the context toolbar drag a CALCULATE onto the canvas. Provide a useful name. In our example this is called
Calculate Value
. - Remove the connection between in and Screen 2.
- Connect the in connection point to the calculate.
Updating Values on an Existing Screen
PhixFlow can update the values on an existing 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.
- 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.
When the actionflow runs it will output the value from the actionflow to your original screen.