# Autogenerating module list in OnDemand interactive apps

**URL:** <https://discourse.openondemand.org/t/autogenerating-module-list-in-ondemand-interactive-apps/1869>\
**Category:** Get Help\
**Tags:** question\
**Created:** [January 14, 2022, 4:16am UTC](https://discourse.openondemand.org/t/autogenerating-module-list-in-ondemand-interactive-apps/1869 "2022-01-14T04:16:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![travert](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/travert/32/3074_2.png) [@travert](https://discourse.openondemand.org/u/travert)\
**Post date:** [January 18, 2022, 3:50pm UTC](https://discourse.openondemand.org/t/autogenerating-module-list-in-ondemand-interactive-apps/1869/2 "2022-01-18T15:50:31Z")

</div>

Hi Martin.

Glad to see some work on something we are trying to also provide support around. The issue I think you are having is that the `ERB` is constantly being rendered and updated. So, each time that happens those module queries are running again and sending the info back.

To avoid this, try to cache those module result locally and use an initializer to set that location. There was a previous discourse that discussed something similar with slurm queues here [Suggestions on generating dynamic form data - #3 by blixuga](https://discourse.openondemand.org/t/suggestions-on-generating-dynamic-form-data/1670/3)

But the main strategy here is to use the initializer to build that array of modules then just use that array for responses that’s cached, and not have the entire module query re-run each time the page updates.

Hopefully that helps, but let us know if you have any other questions or need some clarification.

---

_[View the full topic](https://discourse.openondemand.org/t/autogenerating-module-list-in-ondemand-interactive-apps/1869)._
