All versions of this manual
X
 

Custom actions

In this chapter we cover the following topics:

Custom action example

Custom actions allow to open URLs that can be customized using data from the graph.

Custom actions allows a scenario such as:

  • Given a Company node, the user right-clicks on a node and navigates to Custom actions in the context menu.
  • The user clicks on the appropriate custom action (as there may be more than one). Here Open in Salesforce.
  • A new tab is open in the browser and displays the company's profile page in Salesforce.

Opening SalesForce with a custom action

Creating and managing custom actions

Accessing the custom actions panel

The panel can be accessed through the workspace, by opening the main menu and selecting "Manage custom actions ...".

The panel is available only to users who are authorized to create and manage Custom actions.

Opening the custom action panel

Managing custom actions

From the Custom actions panel, a user may:

  • Create a new custom action.
  • Edit or Delete custom actions they own.
  • View the details of custom actions that they have access to.

Managing custom actions

Creating a custom action

In order to create a custom action a user:

  • must give it a name (mandatory).
  • must provide a URL Template (mandatory, see next section about the syntax).
  • may provide a description.
  • may share it with all users.

Creating a custom action

URL template syntax

A Custom action contains a URL template with one of more variables that are replaced by actual values provided by the context.

Example:

  • Template: https://google.com/?q={{node.first_name}}
  • When running this custom action on a specific node, the {{node.first_name}} variable will be replaced by the first_name property of the selected node.

The following variables can be used in a URL template:

Several variables can be used in the same template (e.g. https://google.com/search?q={{node.city}}+{{node.country}}), with the constraint that "node" and "edge" variables cannot be mixed.

Variables

Node ID

  • Usage: insert the ID of the currently selected node in the URL template.
  • Syntax: {{node}}

By default, a custom action with a {{node}} variable will be available on all nodes. To make this custom action available only for Company nodes, use the following syntax: {{node:"Company"}}.

If multiple "Node ID" variables (or "Node property" variables) are used in a single custom action, they need to all have the same node-category constraint (see example 3).

Examples:

  1. https://example.com/details?node={{node}}
  2. https://example.com/details?node={{node:"Person"}}
  3. https://example.com/node?id={{node:"Person"}}&name={{(node:"Person").name}}

Node property

  • Usage: insert the value of a property of the currently selected node in the URL template.
  • Syntax: {{node.property_name}} or {{node."property name"}} (if the property name contains spaces of special characters).

By default, a custom action with a {{node.property_name}} variable will be available on all nodes. To make this custom action available only for Account nodes, use the following syntax: {{(node:"Account").property_name}}.

If multiple "Node property" variables (or "Node ID" variables) are used in a single custom action, they need to all have the same node-category constraint (see example 4).

Examples:

  1. https://google.com/search?q={{node.firstName}}
  2. https://google.com/search?q={{node.firstName}}+{{node.lastName}}
  3. https://google.com/search?q={{(node:"Person")."First name"}}
  4. https://google.com/search?q={{(node:"Company").name}}+{{(node:"Company").city}}

Edge ID

  • Usage: insert the ID of the currently selected edge in the URL template.
  • Syntax: {{edge}}

By default, a custom action with a {{edge}} variable will be available on all edge. To make this custom action available only for Transaction edge, use the following syntax: {{edge:"Transaction"}}.

If multiple "Edge ID" variables (or "Edge property" variables) are used in a single custom action, they need to all have the same edge-type constraint (see example 3).

Examples:

  1. https://example.com/edge_details?id={{edge}}
  2. https://example.com/edge_details?id={{edge:"Transaction"}}
  3. https://example.com/edge?id={{edge:"Transaction"}}&amount={{(edge:"Transaction").amount}}

Edge property

  • Usage: insert the value of a property of the currently selected edge in the URL template.
  • Syntax: {{edge.property_name}} or {{edge."property name"}} (if the property name contains spaces of special characters).

By default, a custom action with a {{edge.property_name}} variable will be available on all edge. To make this custom action available only for Transaction edge, use the following syntax: {{(edge:"Transaction").property_name}}.

If multiple "Edge property" variables (or "Edge ID" variables) are used in a single custom action, they need to all have the same edge-type constraint (see example 5).

Examples:

  1. https://google.com/search?q={{edge.amount}}
  2. https://google.com/search?q={{edge.amount}}+{{edge.date}}
  3. https://google.com/search?q={{(edge:"Transaction")."credit card"}}
  4. https://google.com/search?q={{(edge:"Transaction").country}}+{{(edge:"Transaction").amount}}

Visualization ID

  • Usage: insert the ID of the visualization in the URL template.
  • Syntax: {{visualization}}

A custom action with a {{visualization}} variable will only be available in regular visualizations (and not in the visualizations of alert's cases).

Examples:

  1. https://example.com/details?viz={{visualization}}
  2. https://example.com/details?viz={{visualization}}&node_id={{node}}

Alert ID

  • Usage: insert the ID of the alert in the URL template.
  • Syntax: {{alert}}

A custom action with an {{alert}} variable will only be available in the visualizations of alert's cases (and not in regular visualizations).

Examples:

  1. https://example.com/details?alert={{alert}}
  2. https://example.com/details?alert={{alert}}&node_id={{node}}

Case ID

  • Usage: insert the ID of the case in the URL template.
  • Syntax: {{case}}

A custom action with a {{case}} variable will only be available in the visualizations of alert's cases (and not in regular visualizations).

Examples:

  1. https://example.com/details?case={{case}}
  2. https://example.com/details?case={{case}}&alert={{alert}}&node_id={{node}}

Page

  • Usage: insert the context of the current page in the URL template.
  • Syntax: {{page}}

When the custom action is executed, this variable is replaced by a URL-encoded JSON object with the following format:

  • if the custom action is executed from a visualization: {source:"visualization", visualizationId:739}
  • if the custom action is executed from an alert's case: {source:"alert", alertId:93, caseId:207}

Examples:

  1. https://example.com/details?page={{page}}
  2. https://example.com/details?page={{page}}&source={{sourceKey}}

SourceKey

  • Usage: insert the SourceKey of the current data-source in the URL template.
  • Syntax: {{sourceKey}}

Examples:

  1. https://example.com/details?source={{sourceKey}}
  2. https://example.com/{{sourceKey}}/{{node:"Company"}}

Base URL

  • Usage: insert the base URL of the Linkurious Enterprise server in the URL template.
  • Syntax: {{baseURL}}
  • Note: the inserted base URL value always ends with a /.

Examples:

  1. {{baseURL}}workspace/new?key={{sourceKey}}&populate=edgeId&item_id={{edge}}
  2. {{baseURL}}workspace/new?key={{sourceKey}}&populate=nodeId&item_id={{node}}
  3. {{baseURL}}plugins/my-plugin/show?key={{sourceKey}}&node={{node}}

Set of node IDs

  • Usage: insert the IDs of all currently selected nodes in the URL template.
  • Syntax: {{nodeset}}
  • Note: the node IDs are inserted as a comma-separated string, e.g. 55,4,128,12

By default, a custom action with a {{nodeset}} variable will be available on all nodes. To make this custom action available only for Account nodes, use the following syntax: {{nodeset:"Account"}}.

Example:

  1. http://example.com/nodes?ids={{nodeset}}
  2. {{baseURL}}plugins/my-plugin/show?nodes={{nodeset:"Company"}}

Set of edge IDs

  • Usage: insert the IDs of all currently selected edges in the URL template.
  • Syntax: {{edgeset}}
  • Note: the edge IDs are inserted as a comma-separated string, e.g. 55,4,128,12

By default, a custom action with a {{edgeset}} variable will be available on all edges. To make this custom action available only for HAS_ACCOUNT edge, use the following syntax: {{edgeset:"HAS_ACCOUNT"}}.

Example:

  1. http://example.com/edges?ids={{edgeset}}
  2. {{baseURL}}plugins/my-plugin/show?edges={{edgeset:"HAS_ACCOUNT"}}

Set of node properties

  • Usage: insert the property-values of all currently selected nodes in the URL template.
  • Syntax: {{nodeset.property_name}}
  • Notes:
    • the node properties are inserted as a comma-separated string, e.g. france,germany,uk
    • empty properties are ignored
    • several {{nodeset}} variables can be used in a template with different property and category constraints

By default, a custom action with a {{nodeset.property_name}} variable will be available on all nodes. To make this custom action available only for Account nodes, use the following syntax: {{(nodeset:Account).propety_name}}.

Example:

  1. http://example.com/nodes?countries={{nodeset.country}}
  2. {{baseURL}}plugins/my-plugin/show?ssn_list={{(nodeset:"PERSON").ssn}}
  3. http://google.com/search?q={{(nodeset:PERSON).name}}+{{(nodeset:PHONE).number}}

Set of edge properties

  • Usage: insert the property-values of all currently selected edges in the URL template.
  • Syntax: {{edgeset.property_name}}
  • Notes:
    • the edge properties are inserted as a comma-separated string, e.g. 55,4,128,12
    • empty properties are ignored
    • several {{edgeset}} variables can be used in a template with different property and type constraints

By default, a custom action with an {{edgeset.property_name}} variable will be available on all edges. To make this custom action available only for TRANSACTION edges, use the following syntax: {{(edgeset:TRANSACTION).propety_name}}.

Example:

  1. http://example.com/edges?amounts={{edgeset.amount}}
  2. {{baseURL}}plugins/my-plugin/show_transactions?numbers={{(edgeset:"TRANSACTION").number}}
  3. http://google.com/search?q={{(edgeset:HAS_ACCOUNT).reference}}+{{(edgeset:TRANSACTION).device}}