# Connecting rasa to database

**URL:** <https://forum.rasa.com/t/connecting-rasa-to-database/57783>\
**Category:** Rasa Open Source\
**Created:** [March 29, 2023, 6:13pm UTC](https://forum.rasa.com/t/connecting-rasa-to-database/57783 "2023-03-29T18:13:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Godo](https://avatars.discourse-cdn.com/v4/letter/g/ee59a6/32.png) [@Godo](https://forum.rasa.com/u/Godo)\
**Post date:** [March 29, 2023, 6:13pm UTC](https://forum.rasa.com/t/connecting-rasa-to-database/57783/1 "2023-03-29T18:13:56Z")

</div>

I want to send the users input to the database when a certain action is triggered so I wanted to know any way to implement that and I want the output in json format and only pass the last stored message of the conversation .The database is postgresql. I was thinking of creating a custom action for this but am not getting how to go about that.

---

<div class="post-metadata">

**Author:** ![anoopshrma](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/anoopshrma/32/13349_2.png) [@anoopshrma](https://forum.rasa.com/u/anoopshrma)\
**Post date:** [March 30, 2023, 6:24am UTC](https://forum.rasa.com/t/connecting-rasa-to-database/57783/2 "2023-03-30T06:24:28Z")

</div>

Hi @Godo ,

You can take this approach:

- Save the required items in slot

- Once you receive the required last message then call a action and there you can connect to the DB and store into it
