Temporary Array?

You can access the data from inside the loop outside it and build your array there. You can find an example of it here in the Function-Node named “Merge Data”: