Store array with one object into an object-variable

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)

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 :wink:

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.

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

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

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.

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