# Dynamic filtering based on data

**URL:** <https://community.weweb.io/t/dynamic-filtering-based-on-data/7118>\
**Category:** Ask us anything\
**Tags:** binding\
**Created:** [February 19, 2024, 3:49pm UTC](https://community.weweb.io/t/dynamic-filtering-based-on-data/7118 "2024-02-19T15:49:17Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrUnfreeze](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@MrUnfreeze](https://community.weweb.io/u/MrUnfreeze)\
**Post date:** [February 19, 2024, 3:49pm UTC](https://community.weweb.io/t/dynamic-filtering-based-on-data/7118/1 "2024-02-19T15:49:17Z")

</div>

Hello,

In my project, each user can set a set of goals, from 1 to X. Each goal has a dedicated showing various information.

I use a “select” component which is bound to a collection of data, so that each user only sees its goals, as below.  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/8/87118872d578e2f069ecfb66d48792bce4e780ee.png)

Now what I would like to do is that whenever a goal is created, all the data fields within the page display the information related to this goal.

For example, here it should show an amount:  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/f/f1dbe500a0ba2816e23d9df9cef0233cd81d0810.png)

I looked at this video: [Dropdown Elements Update](https://community.weweb.io/t/dropdown-elements-update/2841) and tried to replicate the logic as seen below  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/f/f29d9fe26065d36eeff97df41409cb8aad1206a1.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/3/3b7ea8635577bba9b993bf796852f3b4ffbb72a9.png)

But still nothing is shown on the field. Does someone know what I did wrong?

Thank you!!

---

<div class="post-metadata">

**Author:** ![luka](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/luka/32/1571_2.png) [@luka](https://community.weweb.io/u/luka)\
**Post date:** [February 22, 2024, 9:26am UTC](https://community.weweb.io/t/dynamic-filtering-based-on-data/7118/2 "2024-02-22T09:26:02Z")

</div>

Hey, can you give us a little bigger picture of how this screen looks so that I can better understand the context?

---

<div class="post-metadata">

**Author:** ![MrUnfreeze](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@MrUnfreeze](https://community.weweb.io/u/MrUnfreeze)\
**Post date:** [February 22, 2024, 9:40am UTC](https://community.weweb.io/t/dynamic-filtering-based-on-data/7118/3 "2024-02-22T09:40:21Z")

</div>

Hi @luka ,

Thank you for your answer.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/4/4f95f2f268f3e4dd2e38d3c12884155716566b9d.png)

This is the entire screen of the page. On the top left, the user can select a goal, here “Startup” (but it can be any other he/she set up) and then all information underneath, being the progress bars, the text under “Deadline”, “Return”, etc. should change. In this case I try to change to have the text under “Monthly contribution” (here in green)

All these information are bound to the same data collection which is successfully fetched but for some reason it does not display.

I hope I was clearer. Thank you for your support.

---

<div class="post-metadata">

**Author:** ![MrUnfreeze](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@MrUnfreeze](https://community.weweb.io/u/MrUnfreeze)\
**Post date:** [February 25, 2024, 9:14pm UTC](https://community.weweb.io/t/dynamic-filtering-based-on-data/7118/4 "2024-02-25T21:14:36Z")

</div>

Good evening everyone,

I spent the weekend on it and finally made it. I will put the solution if someone ever faces the same problem, I hope it helps. 🤙

The idea is to use a combination of a lookup and getkeyvalues formula. You can see the explanation in this video from Weweb [https://www.youtube.com/watch?v=bXRSGLh\_9H4](https://www.youtube.com/watch?v=bXRSGLh_9H4) that helped me crack it.

---

<div class="post-metadata">

**Author:** ![luka](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/luka/32/1571_2.png) [@luka](https://community.weweb.io/u/luka)\
**Post date:** [February 26, 2024, 9:32am UTC](https://community.weweb.io/t/dynamic-filtering-based-on-data/7118/5 "2024-02-26T09:32:18Z")

</div>

Great! Sorry for being late in responding, quite a busy weekend and the week

---

<div class="post-metadata">

**Author:** ![MrUnfreeze](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@MrUnfreeze](https://community.weweb.io/u/MrUnfreeze)\
**Post date:** [February 26, 2024, 9:47am UTC](https://community.weweb.io/t/dynamic-filtering-based-on-data/7118/6 "2024-02-26T09:47:28Z")

</div>

Hi Luka,

No problem I understand we are many asking for help, it’s already nice of you to take time.

Quick question as a follow-up as there is one I can’t figure out, unfortunately.

![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/3/3ba5d63408a106a7d3d4b046d47812bf3d69af50.png)  
I’d like to display the content within “Strategy” i.e. “US Economy” but it comes as an object. It comes from an array, within the array (collection) I’m already getting my data from. I tried a few things I found on “nested” objects (if it’s the right term) but could not manage to make it work.  
What do I do wrong? Thank you !

---

<div class="post-metadata">

**Author:** ![luka](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/luka/32/1571_2.png) [@luka](https://community.weweb.io/u/luka)\
**Post date:** [February 26, 2024, 9:50am UTC](https://community.weweb.io/t/dynamic-filtering-based-on-data/7118/7 "2024-02-26T09:50:16Z")

</div>

If you want to get the 'US economy" text from the current value what you should do is either:

a) Do another `getKeyValue`

b) Add `.Strategy` at the end

Or are you looking to do something else?

---

<div class="post-metadata">

**Author:** ![MrUnfreeze](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@MrUnfreeze](https://community.weweb.io/u/MrUnfreeze)\
**Post date:** [February 26, 2024, 10:03am UTC](https://community.weweb.io/t/dynamic-filtering-based-on-data/7118/8 "2024-02-26T10:03:53Z")

</div>

Hi,

Thank you. I tried both with various options but must miss something. Do you see where I got it wrong?

1. GetKeyValue  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/c/c032fc0a1edd8288a9f92f9e77dc5618b6aef72a.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/1/1964b31458b5b62e54f56ba6eb7a906117d52261.png)

2. Add .Strategy at the end  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/d/db109a693203b71bd17ccb1e589dbc1e468a1382.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/e/ea8d79db9d4d719e4f7cb737078c832858b1a675.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/0/08a470472045761eb36d8b5b64de5667725ab2bb.png)

---

<div class="post-metadata">

**Author:** ![luka](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/luka/32/1571_2.png) [@luka](https://community.weweb.io/u/luka)\
**Post date:** [February 26, 2024, 2:15pm UTC](https://community.weweb.io/t/dynamic-filtering-based-on-data/7118/9 "2024-02-26T14:15:38Z")

</div>

Ah, its an array

You can add [0].Strategy instead of just .Strategy

---

<div class="post-metadata">

**Author:** ![MrUnfreeze](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@MrUnfreeze](https://community.weweb.io/u/MrUnfreeze)\
**Post date:** [February 26, 2024, 3:21pm UTC](https://community.weweb.io/t/dynamic-filtering-based-on-data/7118/10 "2024-02-26T15:21:05Z")

</div>

Annnd it works ! 🤙 🥳 🥳

---

<div class="post-metadata">

**Author:** ![MrUnfreeze](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@MrUnfreeze](https://community.weweb.io/u/MrUnfreeze)\
**Post date:** [May 27, 2024, 3:40pm UTC](https://community.weweb.io/t/dynamic-filtering-based-on-data/7118/11 "2024-05-27T15:40:51Z")

</div>

Hi @luka

I hope you are well. I have a follow-up question here so I re-open the topic.

I have a data table on Xano whereby for each year, there is a given amount , e.g. 2027 =\> period= 18028 and progression = 0.45

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/b/bdb6c085316fc0e08d199db964f4166022c47b17.png)

Now on my WeWeb page I’d like that when I select a given date (1) e.g. 2027, the progress bar (2) takes the value of the column progression, i.e. here 0.45

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/7/727d04f43eb914020ed684e9a44330557c1aa42b.png)

Based on our previous conversation I have done this but it’s not dynamic with the date.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/b/bf84e84de9e52ac5e3b444b4e599e2b42167c1a0.png)

Would you know how I can make it? Thank you!!

---

<div class="post-metadata">

**Author:** ![luka](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/luka/32/1571_2.png) [@luka](https://community.weweb.io/u/luka)\
**Post date:** [May 29, 2024, 8:11am UTC](https://community.weweb.io/t/dynamic-filtering-based-on-data/7118/12 "2024-05-29T08:11:05Z")

</div>

Are you refetching the collection on change of the year?

---

<div class="post-metadata">

**Author:** ![MrUnfreeze](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@MrUnfreeze](https://community.weweb.io/u/MrUnfreeze)\
**Post date:** [June 2, 2024, 8:06am UTC](https://community.weweb.io/t/dynamic-filtering-based-on-data/7118/13 "2024-06-02T08:06:30Z")

</div>

Hi @luka !

It’s solved thank you. The solution was to work with 2 “filterbykey” to get the collection where the years-related values are stored.

Wish you a nice weekend
