# How can I create a TRIGGER?

**URL:** <https://community.neo4j.com/t/how-can-i-create-a-trigger/5846>\
**Category:** Newbie Questions\
**Tags:** cypher\
**Created:** [March 18, 2019, 4:07pm UTC](https://community.neo4j.com/t/how-can-i-create-a-trigger/5846 "2019-03-18T16:07:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rtelosan](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/rtelosan/32/3746_2.png) [@rtelosan](https://community.neo4j.com/u/rtelosan)\
**Post date:** [March 18, 2019, 4:07pm UTC](https://community.neo4j.com/t/how-can-i-create-a-trigger/5846/1 "2019-03-18T16:07:34Z")

</div>

Hello! I just started using Neo4j.

I have a little pokemon database which I just created. Now I'd like to have a java or python code where I can define a Trigger (I guess I have to do this in external code, not with Cypher in the server browser)

![image](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/2X/0/04177096973998e3d02a21372a49aab24499a2a7.png)

My idea is that now, every time a new pokemon is added, the code should be checking the type of such pokemon, identify the type he is effective against, and making the relationship between that new node and the rest of the Pokemon. Is this achievable in any way? Thanks!

---

<div class="post-metadata">

**Author:** ![david\_allen](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/david_allen/32/13090_2.png) [@david\_allen](https://community.neo4j.com/u/david_allen)\
**Post date:** [March 18, 2019, 4:20pm UTC](https://community.neo4j.com/t/how-can-i-create-a-trigger/5846/2 "2019-03-18T16:20:19Z")

</div>

Use APOC -- it supports definition of triggers. Here are the docs.

[https://neo4j-contrib.github.io/neo4j-apoc-procedures/#triggers](https://neo4j-contrib.github.io/neo4j-apoc-procedures/#triggers)

---

<div class="post-metadata">

**Author:** ![rtelosan](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/rtelosan/32/3746_2.png) [@rtelosan](https://community.neo4j.com/u/rtelosan)\
**Post date:** [March 18, 2019, 4:38pm UTC](https://community.neo4j.com/t/how-can-i-create-a-trigger/5846/3 "2019-03-18T16:38:56Z")

</div>

Thanks a lot! have a good day 🙂
