# Access custom state list in recursive workflow

**URL:** <https://forum.bubble.io/t/access-custom-state-list-in-recursive-workflow/330874>\
**Category:** Database\
**Created:** [July 13, 2024, 7:13pm UTC](https://forum.bubble.io/t/access-custom-state-list-in-recursive-workflow/330874 "2024-07-13T19:13:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hi120](https://avatars.discourse-cdn.com/v4/letter/h/e19b73/32.png) [@hi120](https://forum.bubble.io/u/hi120)\
**Post date:** [July 13, 2024, 7:13pm UTC](https://forum.bubble.io/t/access-custom-state-list-in-recursive-workflow/330874/1 "2024-07-13T19:13:57Z")

</div>

Hi there,

I have a list of multiple texts, returned from the OpenAI API which I temporarily store in a custom state list to feed through a repeating group. In the repeating group the user can then check a box of each text which I then add to another custom state list that stores the selected choices.  
Now I want to save those choices in a field of a newly created datatype in my database. So: 1. Create a new “video” - - Hook=first item from the list. Repeat that process until the list is empty.

 ![Bildschirmfoto 2024-07-13 um 21.04.39](https://us1.discourse-cdn.com/bubble/original/3X/7/8/784a5b48be0066220050439665a94b1bf5047a1f.png)  
 ![Bildschirmfoto 2024-07-13 um 20.59.37](https://us1.discourse-cdn.com/bubble/original/3X/7/8/7831608f432f8cb2a33dae798276563e22f1a0a9.png)

I have looked into API workflows but obviously can’t access my custom state list there. What is the right way to do this?

I hope this makes sense, thank you so much in advance!

---

<div class="post-metadata">

**Author:** ![hergin](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/hergin/32/199185_2.png) [@hergin](https://forum.bubble.io/u/hergin)\
**Post date:** [July 14, 2024, 1:51pm UTC](https://forum.bubble.io/t/access-custom-state-list-in-recursive-workflow/330874/2 "2024-07-14T13:51:35Z")

</div>

You should first create an API workflow that accepts a single hook and does whatever you need. Then, you need to schedule API workflow on a list of things either recurring or with a frontend action. See the picture for a recurring one. The list to run on will be the custom state on your repeating group.

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/d/c/dcb348f36fa0170e8391935b17bd60508f089aef.png)

Also, in your first picture, see the `workflow data source`, it will probably be a hook as a parameter in your API workflow.

> [@hi120](#):
>
> ![Bildschirmfoto 2024-07-13 um 21.04.39](https://us1.discourse-cdn.com/bubble/original/3X/7/8/784a5b48be0066220050439665a94b1bf5047a1f.png)
