# How do I loop a question through database?

**URL:** <https://forum.rasa.com/t/how-do-i-loop-a-question-through-database/40528>\
**Category:** Rasa Open Source\
**Created:** [February 23, 2021, 11:07am UTC](https://forum.rasa.com/t/how-do-i-loop-a-question-through-database/40528 "2021-02-23T11:07:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![arkaprabha-majumdar](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/arkaprabha-majumdar/32/12446_2.png) [@arkaprabha-majumdar](https://forum.rasa.com/u/arkaprabha-majumdar)\
**Post date:** [February 23, 2021, 11:07am UTC](https://forum.rasa.com/t/how-do-i-loop-a-question-through-database/40528/1 "2021-02-23T11:07:09Z")

</div>

I knew how to do this, but I simply cant remember. So, I have a database in the form of a dictionary of items, say, for example {‘id’:‘100’, ‘pens’:‘3’, ‘wood planks’:‘2’, ‘knife’:‘5’, … }

I need to loop my rasa bot through this dictionary, and make it say:

- did you order 3 pens? user reply :“yes”
- did you order 2 wood planks? user reply :“yes”
- did you order 5 knives? user reply :“yes” etc.

if user says no on any of the items, then I want to go into another action to rectify that item and resume this confirmation… Help

---

<div class="post-metadata">

**Author:** ![Juste](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/juste/32/15_2.png) [@Juste](https://forum.rasa.com/u/Juste)\
**Post date:** [February 24, 2021, 1:57pm UTC](https://forum.rasa.com/t/how-do-i-loop-a-question-through-database/40528/2 "2021-02-24T13:57:01Z")

</div>

Hi @arkaprabha-majumdar . A simple way to achieve that would be to have custom action which loops through the details in your db
