# Component Action doesn't trigger its own Workflow

**URL:** <https://community.weweb.io/t/component-action-doesnt-trigger-its-own-workflow/15031>\
**Category:** Ask us anything\
**Created:** [December 19, 2024, 12:21pm UTC](https://community.weweb.io/t/component-action-doesnt-trigger-its-own-workflow/15031 "2024-12-19T12:21:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vfede](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/vfede/32/14020_2.png) [@vfede](https://community.weweb.io/u/vfede)\
**Post date:** [December 19, 2024, 12:21pm UTC](https://community.weweb.io/t/component-action-doesnt-trigger-its-own-workflow/15031/1 "2024-12-19T12:21:48Z")

</div>

Hi all,  
first thread here, loving weweb so far.

i’m building a simple marketplace with filterable listing, i’m working with some Input multiselect. i made a component and so far with user input they work perfectly.  
Now i’m trying to assign the currentSelection value programmatically (i need to read it from the query string)  
I tried set the Initial value but this doesn’t trigger the onChange workflow that changes the filters and update the filtered collection.

I created a Set Value Action on the Input Multiselect component. It set the currentSelection to update the UI of the multiselect and then triggers the onChange event. When i run this workflow with the test values, the variable is changed and the event is triggered in the log…but not really: the component’s instance that has a workflow on the onChange event doesn’t seem to do anything, the actions in “Filter by Providers” don’t happen (it just set a filtering variable and fetch a collection with the new filter).

**Actions and triggers within the Input multiselect component “Filter DD”:**

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

**Set Value workflow:**

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

**OnChange on the instance of the component**

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

Similar thing with a page workflow “on page load before fetching collection”:  
i set the parameter that is used to filter the collection (i read it from queryparam). the collection is then not filtered. if i switch the workflow to just “on page load” and add the a “fetch collection” action, then all is good.

am i missing something about these workflows? or probably some error on my side or bug…

thanks to anyone that will clarify these. great community!

---

<div class="post-metadata">

**Author:** ![vfede](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/vfede/32/14020_2.png) [@vfede](https://community.weweb.io/u/vfede)\
**Post date:** [December 20, 2024, 12:01pm UTC](https://community.weweb.io/t/component-action-doesnt-trigger-its-own-workflow/15031/2 "2024-12-20T12:01:24Z")

</div>

i suspect the first problem occurs only with the “test” button, not if i invoke the Set Value from a button or another workflow

---

<div class="post-metadata">

**Author:** ![DanielL](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/daniell/32/13398_2.png) [@DanielL](https://community.weweb.io/u/DanielL)\
**Post date:** [December 20, 2024, 5:11pm UTC](https://community.weweb.io/t/component-action-doesnt-trigger-its-own-workflow/15031/3 "2024-12-20T17:11:55Z")

</div>

Hi @vfede 👋

I think this is normal JS behavior. Can you please try to handle this in the page’s initialization workflow and let me know if it works?

Create a workflow on page load in which you:

- Get query parameter
- Set value (for multiselect)
- Update variable (for filter state)
- Fetch collection
