As a more traditional developer, returning data from sub-routines is assumed, in various shapes and protocols. Not so with ‘low-code’ PowerApps Flows.

This is made all the more involved and tricky to return actual objects between Flows. Instead of returning objects that are already persisted in DataVerse, for example, you might want to return a comma-delimited set of IDs as a single string. You can then expand these and iterate through them.

In the Child Flow

  • If you are dealing with objects, pluck the fields out you need using the Select Action.
  • Convert your array to a string to return using a “Respond to PowerApp or Flow” Action, delimited by comma.

This will make your Flow look like:

In the calling/parent Flow

  • Call the Child Flow.
  • Convert your returned string back to an array using the split function. The expression will look something like split(outputs('Get_matching_items')?['Body']?['matchingitems'],',').
  • This will give you a minimum of one array element, even if your input array was empty so you need to filter that by using an “Array Filter” Action to remove empty items (assuming your array doesn’t have legitimate empty items).

This will make your Flow look like:

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Quote of the era

In the beginning there was Jack … and Jack had a groove. And from this groove came the groove of all grooves. And while one day viciously throwing down on his box, Jack boldly declared “Let There Be House” and House music was born.

~ Chuck Roberts