Overview
In a PhixFlow application, you can configure drag-and-drop actions using actionflows and table actions. Some examples of drag and drop actions are:
Dragging a record from a grid onto a delete area to remove it.
Dragging a contact from one grid onto a specific company on a company table to move that contact to that company.
Dragging items into different sections on a Kanban board to change the state of the record. See Making Kanban Boards.
Setting up Drag and Drop
To set up drag and drop on components, a Drag Type on the object you are dragging from and a Drop Target on the object you are dropping onto is required. Components that can have drag types are grids and card components. Any component which has an actions tab can be a drop target. The action is configured on the drop target.
For example, to assign a new company to a contact a user creates two grids on a screen
The contact and company table have a relationship and linked by a CompanyID field. The contact can be dragged and dropped onto a company to update CompanyID. The contact is the Drag Type and the company grid is the Drop Target.
Defining a Drag Type
Open the properties for the view from which data will be dragged.
For example, right-click on the grid and select Show the View ConfigurationNavigate to the Actions tab
In Action Settings → Drag Type, select or create a drag type, e.g. Move Contact.
This drag type needs to match the drag type defined on the drop target.
If using an actionflow, it is essential to add Drag Mappings to attributes from the source table to attributes used within the actionflow. If using table-actions, skip this step. In this example, we need to know the ID of the contact to be updated. To add Drag Mappings
Open the editor for the Drag Type by clicking on the field label
Add an attribute and name this ContactID
Change the Type to Integer
Save the attribute
In Action Settings → Drag Type Mappings, click Add Mapping to open the mapping popup.
Map the ContactID from the Grid to ContactID on the Drag Type
Components with a drag type can be dragged and dropped onto any component which has a drop target with a matching drag type. It is on the drop target where the action is configured.
Drag Type Properties
For information about the properties toolbar, and about the sections Parent Details, Analysis Models, Description and Audit Summary, see Common Properties. We recommend you always add a Description that explains the purpose of the item you are creating.
For a full list of all the PhixFlow property tabs and windows, see Properties, Windows, Menus and Toolbars.
The Basic Settings are:Field | Description |
---|---|
Name | Enter a name for the drag type. |
Attributes | Drag type attributes are attributes that can be used within an actionflow. Add attributes here and map them to view attributes under Action Settings → Drag Type Mappings of the View Properties. |
Defining a Drop Target
Open the properties for the component where the data will be dropped. In the above example, this would be the Company grid.
Navigate to the Actions tab.
In Drop Targets, click Create New to create a new one.
Provide a descriptive name, such as Move Contact to New Company
Select the drag type (e.g. Move Contact) which matches the drag type of the component being dragged.
Select the action to run when something of the same drag type is dropped onto this component.
If setting up a table-action see Using the Drag Type and Drop Target in a Record-Action below.
If setting up an actionflow, see Using the Drag Type and Drop Target in an Actionflow below
Drop Target Properties
For information about the properties toolbar, and about the sections Parent Details, Analysis Models, Description and Audit Summary, see Common Properties. We recommend you always add a Description that explains the purpose of the item you are creating.
For a full list of all the PhixFlow property tabs and windows, see Properties, Windows, Menus and Toolbars.
The Basic Settings are:Field | Description |
---|---|
Name | Enter a name for the drop target. |
Drag Type | Select the drag type, or Create New a new one. |
Action | Select the action to perform when items are dropped on the target view. |
Using the Drag Type and Drop Target in an Actionflow
Drag Types and Drop Targets can be used as inputs into an actionflow. To configure an actionflow to move a contact to a new company
Click Connect under Connections on the actionflow to create a new input
Select the Drag Type (e.g. Move Contact). This represents the Contact that is being dragged and the record that needs to be updated. This is what is driving the actionflow.
Map the Drag Type attribute (e.g. ContactID) to the interface of the actionflow.
Click Add under Connections on the actionflow to create a new connection for the Drop Target. The actionflow needs to lookup the new CompanyID from the drop target.
Name the connection point lu
Select a Lookup connection. To learn more about lookups, see Using Lookups.
Click Create Connection Point
Select the Drop Target (e.g. Update Company). This represents the Company that is being dropped onto.
Map the required attributes to the interface of the actionflow. In this example, only CompanyID is required.
Create a Calculate node by dragging and dropping from the toolbar.
Name this Move Contact
Connect the calculate to the input, in, of the actionflow by dragging from in to Move Contact.
Map ContactID to the calculate node
Connect the calculate to the lookup, lu, of the actionflow by dragging from lu to Move Contact.
Click Create Lookup
Name the lookup lu
Map CompanyID to the calculate node
Open the editor for the Calculate by clicking on the node.
Add a calculate attribute
Name NewCompanyID
Type String
Order 1
Expression
lu.CompanyID
Create a Save node by dragging and dropping from the toolbar.
Name this Save Contact
Select the Contact table
Open the editor for the Save node.
Click Attributes to open the attribute picker
Drag and drop the CompanyID onto the Save Attributes. The ContactID (primary key) of the table should be added by default.
Connect the Calculate to the Save
Map ContactID to ContactID
Map NewCompanyID to CompanyID
The actionflow is now configured.
Using the Drag Type and Drop Target in a Record-Action
If using a table-action on the drop target you can use the following to define the data.
Record-Action → Basic Settings → Filter Type options:
Dragged Items defines what data is expected from a dragged
Drop Target Items defines what to do with the data.
In addition, you can use the following variables in context parameters and record-action attribute expressions:
_dragSource In a drag action, all information from the source is passed to the drop target. Use this variable to select the specific information required by the target.
_dropTarget specify the location where data can be dropped.
_dropPosition specify drop target co-ordinate values.
Learn More
For links to all pages in this topic, see Connecting Events to Actions
Terminology changes in progress
As part of the redesign of PhixFlow, we are changing the following terms:
dashboard → screen
stream → table
stream attributes → attributes
stream item → record
stream set → recordset
stream view → view
stream item action → record-action
stream action → table-action
driver class → database driver