# Error while using an iteration in a custom component

**URL:** <https://community.appfarm.io/t/error-while-using-an-iteration-in-a-custom-component/1459>\
**Category:** Bug reports\
**Created:** [October 18, 2024, 9:08am UTC](https://community.appfarm.io/t/error-while-using-an-iteration-in-a-custom-component/1459 "2024-10-18T09:08:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yassine.tebib](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/yassine.tebib/32/74_2.png) [@Yassine.tebib](https://community.appfarm.io/u/Yassine.tebib)\
**Post date:** [October 18, 2024, 9:08am UTC](https://community.appfarm.io/t/error-while-using-an-iteration-in-a-custom-component/1459/1 "2024-10-18T09:08:20Z")

</div>

Hey Appfarm

We have this message error in a filter while using an iteration inside of a custom component

can we have more details about it ? because our enum still exist (enum of type string )

the same filter works without custom component

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/5/5c57a2ec80ffad98bb4bfa0f90a291aa1b1c2eac.png)

Thanks 😃

---

<div class="post-metadata">

**Author:** ![karlh](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/karlh/32/2567_2.png) [@karlh](https://community.appfarm.io/u/karlh)\
**Post date:** [October 18, 2024, 11:46am UTC](https://community.appfarm.io/t/error-while-using-an-iteration-in-a-custom-component/1459/2 "2024-10-18T11:46:39Z")

</div>

Hi @Yassine.tebib  
Can you share some more details about the setup?  
Is the enum passed into the component as a component parameter and then used as a filter within the iterating container? Can you also share how the filter is set up?

---

<div class="post-metadata">

**Author:** ![JustineC](https://avatars.discourse-cdn.com/v4/letter/j/ecae2f/32.png) [@JustineC](https://community.appfarm.io/u/JustineC)\
**Post date:** [October 23, 2024, 6:32am UTC](https://community.appfarm.io/t/error-while-using-an-iteration-in-a-custom-component/1459/3 "2024-10-23T06:32:22Z")

</div>

Hi, I’m Yassine’s colleague.

The issue was that I was using app data directly without passing it through a component parameter. I was able to resolve this by passing my RT through a component parameter.

However, now I face a new problem: I want to apply a filter on the component parameter within a function, but it seems like this isn’t possible. I’m using this function inside a motion to conditionally display an element. How can I work around this?

To illustrate:

Here, I pass my RT directly and filter on it.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/b/b5e1defeb31bf61bef03059a435daa546f395293.png)

But I can’t filter on the component parameter.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/2/2d9536281543f28c2579de94871ddc94e7e2fe6f.png)

Thanks in advance for your help!

---

<div class="post-metadata">

**Author:** ![karlh](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/karlh/32/2567_2.png) [@karlh](https://community.appfarm.io/u/karlh)\
**Post date:** [October 23, 2024, 7:17am UTC](https://community.appfarm.io/t/error-while-using-an-iteration-in-a-custom-component/1459/4 "2024-10-23T07:17:43Z")

</div>

Hi @JustineC . Unfortunately, using component params with filters in a function param will not work. However, this has already been requested and will be available soon.  
Until then you might set this as an app-variable and feed it into the component-function. Could that work in your scenario?

---

<div class="post-metadata">

**Author:** ![JustineC](https://avatars.discourse-cdn.com/v4/letter/j/ecae2f/32.png) [@JustineC](https://community.appfarm.io/u/JustineC)\
**Post date:** [October 23, 2024, 7:32am UTC](https://community.appfarm.io/t/error-while-using-an-iteration-in-a-custom-component/1459/5 "2024-10-23T07:32:18Z")

</div>

Ok, I will try that.  
Thanks for your answer,

Have a great day !
