Return Arrays from Power Automate to Power Apps without a premium licence
Avoiding the premium licences
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:
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:
And use some code to set this collection using the following one liner
Then for each field we want to display inside the gallery
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.
Continue Reading Pieter Veenstra’s Article on their blog
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 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.
Blog Syndicated with Pieter Veenstra’s Permission
More About This Author
- ModernWorkplace2022.11.18Create multi user real time apps in Power Apps
- ModernWorkplace2022.11.17Sort by Title in your Highlighted Content web part in SharePoint
- ModernWorkplace2022.11.15Copy large files from SharePoint to Azure Blob Storage using Power Automate
- ModernWorkplace2022.11.10Sort an array by dates in Power Automate