How to Implement "One Click" Scene Clear and load new pattern in Neo4j Bloom?

Dear community,

I'm trying to implement feature in Neo4j Bloom by having a single click (or action) that will first clear the current scene (return nothing), and then immediately load a new pattern or subgraph for exploration, in another word to start further exploration based on current scene in a new scene. I tried using Scene Actions, but since Bloom only allows one Cypher statement per action, I can't chain a "clear" and a "load" together.

Has anyone found a way to implement this "one click to clear and reload" pattern in Bloom? Are there any workarounds, plugins, or best practices to achieve this? Any advice or examples would be appreciated!

This is what I was trying to implement in the scene actions under ‘saved cypher’ section

One other relevant issue is since id(n) will be deprecated - which other id should we use for scene actions? below using the unique ID didn’t work

MATCH p=(e:Employee)-[r]->()
WHERE e.id IN $nodes
RETURN p LIMIT 10;

Hi @mengjiakang2017, apologies for the late reply.

In regards to the deprecated id function, you can switch to using elementId instead, which is the recommended way going forward and also supported by Bloom.

In regards to clearing the current scene as part of a scene action, I’m afraid that is not possible. Scene actions can only add new data to the scene but not manipulate the existing scene. A workaround I can think of is the turn on the setting “Search results highlight” in the Settings drawer. That way, when the scene action has completed, you can easily remove all previous nodes with the “Dismiss other nodes” action.

I hope this helps and answers your question. Please let me know if you have further questions or comments.