Scene actions

Scene actions are parameterized Cypher queries, much like Search phrases. The difference is that in a Scene action, the parameters can be the selected elements in your current selection instead of all available and matching elements in your graph. Also, whereas Scene actions are defined in the Perspective drawer under Saved Cypher, they are invoked from the context menu.

A Scene action can be sent as either a READ or a WRITE transaction to the database (provided you have appropriate permissions). In order to send as a WRITE transaction, you need to first enable this in the Settings drawer. Bloom can detect certain WRITE queries based on a number of keywords, and if your query doesn’t contain any of the keywords, you need to check the Write transaction box in order for the transaction to be sent as a WRITE. If the Write transaction box is checked, the query is always sent as a WRITE transaction.

The Scene actions are listed in the order they were created. Bloom lets you reorder them any way you like by dragging and dropping them as you please in the Perspective drawer. The order of Scene actions in the Perspective drawer is also reflected from the context menu.

scene action context

In the following example, using the Northwind graph, a Scene action, Discontinued products, is created (and saved) based on the selected nodes in the scene. This Scene action is available from the context menu when node(s) are selected and displays products that have been discontinued from the selected suppliers.

scene action

The Cypher function id is deprecated in Neo4j 5 and will be removed. It is replaced by elementId. Existing Scene actions containing id still works with Neo4j 5, but any new actions should use elementId. However, if you use Neo4j 4.x, you must use id.

It is possible to make the Scene action available for only some categories, you control this in the Action Availability dropdown menu.

action availability

If a relationship is selected instead of nodes, the Discontinued products Scene action is not available, which is a result of the WHERE elementId(n) in $nodes on the second line of the Cypher query.

scene action relationship

If you write a Scene action where your query targets relationships rather than nodes, they are defined in a similar fashion, WHERE id(r) in $relationships. However, Bloom reminds you if you forget.

Only the distinction between $nodes and $relationships matters to a Scene action’s availability for a selected element. Any further refinement, such as the p.discontinued=true in the example, is ignored in from this point of view. For example, if you select a Supplier node that is not connected to any discontinued products, the Scene action Discontinued products is still available, but running it does not yield any results.