Categories: Microsoft Flow

Compose actions inside apply to each steps in Microsoft Flow

Today I came across  a weird feature in Microsoft Flow. I collected a list of files from SharePoint and I was setting a Compose with the title of my files. In the run history each file was listed and I was quite happy with this. Inside the apply to each step can use this value.

But what if I use this outside the Apply to each after the Apply to each has finished. To my surprise I was getting an array back.

My first thought was: “That is annoying. That can’t be right!”

But you could use this to filter your arrays.

With the condition set to:

startsWith(outputs('Compose_-_File_name'),'t')

This now resulted in an array just giving me the files starting with the letter t.

However I found that the array returned looked like this:


[null,"text","test2",null,"tf78062375",null,null,null,null,null]

Concurrency

It looks like the compose actions inside the apply to each steps are created as an array. Why?

Although by default the Concurrency is switched of on every Apply to each step. It is possible to enable this. To make sure that things don’t go wrong and data would get mixed up, an array of compose actions is created.

 

The advanced method

Do you want to take this method further, then read The advanced Pieter’s method in Power Automate

Share
Pieter Veenstra

Business Applications and Office Apps & Services Microsoft MVP working as a Microsoft Productivity Principal Consultant at HybrIT Services. You can contact me using contact@veenstra.me.uk.

View Comments

  • Hi Pieter,

    I am facing a weird scenario where I am using the same functionality but outputs('compose') is giving me null. Is there any specific condition that needs to be fulfilled for outputs('compose') to work after setting in Apply to each loop.

    Thanks

    • Compose need to match the name of the compose action.

      So most likely

      outputs('Compose') instead of outputs('compose')

Recent Posts

Create new group alert using Power Automate

Do you want to know when a new group has been created with for example…

3 days ago

Delegation Warnings in Power Apps

We have all seen them, Delegation Warnings, but what is delegation and how do you…

3 days ago

1 Top tip: PowerPlatformLearn.com and master the Power Platform within no time

It can be difficult to get started with the Power Platform, blogs help, training helps,…

2 weeks ago

Compare 2 Excel files using Power Automate

This is such a common scenario. You receive Excel files on a regular basis and…

2 weeks ago

Rename SharePoint folders using Power Automate in 2 easy steps

Have you ever wanted to rename SharePoint folders with Power Automate? REST API call to…

3 weeks ago

Read dates from Excel with Power Automate

To read dates from Excel files can be tricky, as Excel only give you the…

4 weeks ago
%%footer%%