When you want to return arrays from a flow in Power Automate to an app in Power Apps you could use the Response action, however this requires a premium connector

Avoiding the premium licences
Table of Contents
First of all if your flow really uses premium features then just get that premium licence in place, but if you don’t use any other premium features then you might want to use the method described in this post to avoid the costs of a premium licence.
In my case my client wanted to display documents in a a document library and enable the management of document versions inside an app.
Building the flow
So I started by creating a flow that asks for the ID of a document and then all the versions are returned by the REST API call following.

The above returns potentially a lot of data that we want to send to the app.
The data that we get returned will need to be reshaped using the apply to each with a compose action side. Simply create a list of fields returned by the Apply to each and separate them by something that you would never find in the data. I’m using ### in this case.

Now we just need to return this to the app:

join(outputs('Compose'),'##Version##')
This will now give us an array of data where each item is separated by ##Version## and each field is separated by ###
Using the data in the app
Now within the app we can create a gallery that has the following items code:
colVersionHistory
And use some code to set this collection using the following one liner
ClearCollect(colVersionHistory, Split(Getversionsofdocuments.Run(ThisItem.ID).result,”##Version##”).Result);
Then for each field we want to display inside the gallery
Index(Split(ThisItem.Result,"###").Result,1).Result
The above will get the first field. To get the second field simply replace the 1 with a 2 and so on.
And that is it. An easy way to send arrays of data back to your app.
Hey Pieter,
Thank you for sharing this, what is your thoughts on using the methood as in this youtube video?
https://www.youtube.com/watch?v=cUKtQslS68E
The reason why I am asking because you have a for each loop, and if you were to grab say some 300 items, that loop would be running 300 times, and depending on how big the list it, it could eat up a fair bit of API requests.
Cheers
Sorry for my second reply, there is also this one as well that is even better than the youtube video: https://steelcutbytes.com/2021/12/06/easily-collect-array-data-in-powerapps-from-a-flow/
Hi Daniel,
That roughly uses the same idea. I’m only displaying the array in a gallery where in that recording the data is being processed in a ForAll . ForAll processing is in general quite slow. So I’m not sure if I would use the ForAll, but the idea of passing arrays between flows and apps is the same.