# Store array with one object into an object-variable

**URL:** <https://community.weweb.io/t/store-array-with-one-object-into-an-object-variable/21564>\
**Category:** Ask us anything\
**Created:** [August 27, 2026, 7:12am UTC](https://community.weweb.io/t/store-array-with-one-object-into-an-object-variable/21564 "2026-08-27T07:12:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![WimDC](https://avatars.discourse-cdn.com/v4/letter/w/8e7dd6/32.png) [@WimDC](https://community.weweb.io/u/WimDC)\
**Post date:** [August 27, 2026, 7:12am UTC](https://community.weweb.io/t/store-array-with-one-object-into-an-object-variable/21564/1 "2026-08-27T07:12:55Z")

</div>

Hi,  
in my project I have

- a global variable of type “object” used and working perfectly on many pages.
- several collections, binded to an Baserow-table

Now, I have a new workflow and at the end, I filter one of those collections by key (like id=123) so the result is an array of only one object with all the fields of id=123. But it’s still an array (result shows square bracket at beginning) \> Formula “FilterByKey” doesn’t work as it returns an array of one object ( [Array Formulas | Documentation](https://docs.weweb.io/formulas/array.html))

How can I store this one object in my global “object-variable”? A simple “change variable value” with that filtered collection doesn’t work because different types (array vs object).

And no, I will not change the type of my global variable to type=array because this breaks the rest of my project. I has to be of type=object 😉

---

<div class="post-metadata">

**Author:** ![ishika](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/ishika/32/13250_2.png) [@ishika](https://community.weweb.io/u/ishika)\
**Post date:** [August 27, 2026, 8:49am UTC](https://community.weweb.io/t/store-array-with-one-object-into-an-object-variable/21564/2 "2026-08-27T08:49:21Z")

</div>

Hey @WimDC!  
Have you tried something like `filteredResult[0]`?

That should work if you know the filter will only return one item each time, since it takes the object at index 0 out of the array.

---

<div class="post-metadata">

**Author:** ![WimDC](https://avatars.discourse-cdn.com/v4/letter/w/8e7dd6/32.png) [@WimDC](https://community.weweb.io/u/WimDC)\
**Post date:** [August 27, 2026, 9:06am UTC](https://community.weweb.io/t/store-array-with-one-object-into-an-object-variable/21564/3 "2026-08-27T09:06:08Z")

</div>

and how can I write this `filteredResult[0]` in my formula with the action “change variable value”?

---

<div class="post-metadata">

**Author:** ![ishika](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/ishika/32/13250_2.png) [@ishika](https://community.weweb.io/u/ishika)\
**Post date:** [August 27, 2026, 9:15am UTC](https://community.weweb.io/t/store-array-with-one-object-into-an-object-variable/21564/4 "2026-08-27T09:15:18Z")

</div>

Can you please share some screenshots so that I can better explain how to set it up 🙂

---

<div class="post-metadata">

**Author:** ![WimDC](https://avatars.discourse-cdn.com/v4/letter/w/8e7dd6/32.png) [@WimDC](https://community.weweb.io/u/WimDC)\
**Post date:** [August 27, 2026, 11:20am UTC](https://community.weweb.io/t/store-array-with-one-object-into-an-object-variable/21564/5 "2026-08-27T11:20:26Z")

</div>

![Schermafdruk van 2026-08-27 13-11-46](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/3X/3/6/3659bf04d21fc039eccbdca1e80d6ed07cbecc83.png)

The formula in my workflow to change the variable value works correctly, so I get the correct data, but the result is still an array, so the information is not stored in the variable “gekozen\_repetitiedatum” that is of type “object”.

BUT…

I now found the Action.Result[0] in the fourth tab (workflow) and added a second action to change the value of my object-variable.

 ![Schermafdruk van 2026-08-27 13-18-29](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/3X/5/3/53013f351329f26df183de660e01092410fb9d21.png)

AND… this seems to work.  
I can now further test the workflow.

But it seems that you helped my by pointing me in the correct direction. THANKS
