# How to configure collection from JSON database

**URL:** <https://community.weweb.io/t/how-to-configure-collection-from-json-database/4133>\
**Category:** How do I?\
**Created:** [August 31, 2023, 4:37pm UTC](https://community.weweb.io/t/how-to-configure-collection-from-json-database/4133 "2023-08-31T16:37:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Novice](https://avatars.discourse-cdn.com/v4/letter/n/a87d85/32.png) [@Novice](https://community.weweb.io/u/Novice)\
**Post date:** [August 31, 2023, 4:37pm UTC](https://community.weweb.io/t/how-to-configure-collection-from-json-database/4133/1 "2023-08-31T16:37:04Z")

</div>

Hi, I’m totally new with WeWeb and doesn’t know programming either…  
I’m trying to make a dynamic collection to a construction database (JSON file). Here is more details of it: [Carbonneutralfinland \> Construction emission database CO2data.fi](https://www.hiilineutraalisuomi.fi/en-US/Tools_and_services/Construction_emission_database)

here is the database: [https://co2data.fi/api/co2data\_construction.json](https://co2data.fi/api/co2data_construction.json)

Could you advice how can I configure it correctly, thanks.

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [August 31, 2023, 4:48pm UTC](https://community.weweb.io/t/how-to-configure-collection-from-json-database/4133/2 "2023-08-31T16:48:24Z")

</div>

1. Install the plugin for REST
2. You need to set up a REST API request like this:  
@Alexis for some reason I get a Network error when I try to fetch this as a dynamic collection.

 ![Screenshot 2023-08-31 at 18.47.18](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/e/e85faeb28255616bb28ffc1fee65ffd562cb2c97.png)

Then with the data, you can do anything you need @Novice

---

<div class="post-metadata">

**Author:** ![Alexis](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/alexis/32/13248_2.png) [@Alexis](https://community.weweb.io/u/Alexis)\
**Post date:** [August 31, 2023, 4:58pm UTC](https://community.weweb.io/t/how-to-configure-collection-from-json-database/4133/3 "2023-08-31T16:58:25Z")

</div>

Its a CORS issue. It happen when the API doesn’t allow cross domain origin. The browser will block the request. We made an option specially to overcome this limitation. You can select Make this reques through a server and it will works! 🎉

 ![Capture d’écran 2023-08-31 à 18.55.42](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/4/4d4102e10688167ee4d8958357a7d651fe49ed56.png)  
 ![Capture d’écran 2023-08-31 à 18.56.26](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/6/6702f7b25d41bc2c7688ff79b18417eca290319e.png)

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [August 31, 2023, 5:01pm UTC](https://community.weweb.io/t/how-to-configure-collection-from-json-database/4133/4 "2023-08-31T17:01:56Z")

</div>

How come it works with Static but not with Dynamic? Is it a different way of fetching things?

---

<div class="post-metadata">

**Author:** ![Alexis](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/alexis/32/13248_2.png) [@Alexis](https://community.weweb.io/u/Alexis)\
**Post date:** [August 31, 2023, 5:05pm UTC](https://community.weweb.io/t/how-to-configure-collection-from-json-database/4133/5 "2023-08-31T17:05:59Z")

</div>

Static are fetched on the backend! Static are never fetched from the browser.

In the editor you can fetch them multiple time, but on the published app a static collection is fetched only at the build time, we store them and serve them when needed, this is how you can use them to build static collection page, because we fetch them at the build time and create a page for every item in the static collection.

---

<div class="post-metadata">

**Author:** ![Novice](https://avatars.discourse-cdn.com/v4/letter/n/a87d85/32.png) [@Novice](https://community.weweb.io/u/Novice)\
**Post date:** [August 31, 2023, 5:06pm UTC](https://community.weweb.io/t/how-to-configure-collection-from-json-database/4133/6 "2023-08-31T17:06:44Z")

</div>

Worked! Thanks a lot!

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [August 31, 2023, 5:07pm UTC](https://community.weweb.io/t/how-to-configure-collection-from-json-database/4133/7 "2023-08-31T17:07:07Z")

</div>

Indeed, makes sense) Glad it worked @Novice
