How do I filter an array, or loop over it?

Before proceeding, please use the forum search feature at the top of the page to check if your question has already been answered.

How do I filter an array, or loop over it?

I’m calling a function in an extension (MQTT::GetLastMessage()), which returns an array of structures. I save the returned data to a scene variable. (I can change to a global variable, if needed).

The length of the returned array varies a bit. I’d like to process the array in ways that are not clear to me yet (I’m in an exploratory phase), but likely, I want to filter the array, so that only items with a certain value of a child node are passed through. The items that pass through the filter will later move objects on the screen.

How can I iterate over the array?
How can the array be filtered?

What is the expected result

Get the data for the wanted tagId, and use it in the “game”. Note that the structures in the array are populated to varying extent. Hopefully not a problem.

What is the actual result

I don’t know how to do this.

Related screenshots

Here is some data of the kind that I want to process. In this case, there are 3 items in the array, and I want to filter on tagId.


Project files (optional)

Insert a minimal game showing your issue in a .zip or .rar.

Thanks for the reply.

Where can I find “For every child in …”?
I don’t fully understand if it should go into the conditions or the action column, and what terms I should use in the search field for conditions or actions.


1 Like