Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Apply_to_each is bypassed

(0) ShareShare
ReportReport
Posted on by 14

Hi everyone, I've built a flow that has run successfully a few times. Today I've gone to run the process again and it bypasses my "Apply_to_each" so none of the actions within are processed.

 

The flow is triggered by a file being added to a SharePoint folder. The data is captured from the file, and then I use the "Apply_to_each" to process the data. There's definitely data there as I have checked the Compose output before the "Apply_to_each".

 

Does anyone know why this might be happening? The flow "succeeds" but none of the actions actually happen.

MattCB_0-1642794244849.png

 

MattCB_0-1642794611001.png

 

Compose is: 

split(outputs('Get_file_content')?['body'], decodeUriComponent('%0D%0A'))
 
Apply_to_each is:
skip(outputs('Compose'),1)
 
Compose 5:
replace(item(),'    ',',')
 
Compose 2:
split(outputs('Compose_5'),',')

 

 

  • Pstork1 Profile Picture
    67,060 Most Valuable Professional on at
    Re: Apply_to_each is bypassed

    I would do the split() each way and then check the length() of the array that is output.  Use whichever split() leads to the highest length()

  • MattCB Profile Picture
    14 on at
    Re: Apply_to_each is bypassed

    I think I know the answer to my own question - parallel branch? 

  • MattCB Profile Picture
    14 on at
    Re: Apply_to_each is bypassed

    Thank you, this has really helped. Do you know how I might include a check for one or both within the same flow? 

  • Pstork1 Profile Picture
    67,060 Most Valuable Professional on at
    Re: Apply_to_each is bypassed

    It can depend a lot on the document.  I've seen cases where one or the other doesn't show up, or the spacing is off, or the order is backwards.  There can be a variety of reasons.

  • MattCB Profile Picture
    14 on at
    Re: Apply_to_each is bypassed

    @Pstork1 might you know why the input document isn't finding the carriage return and linefeed? 

  • MattCB Profile Picture
    14 on at
    Re: Apply_to_each is bypassed

    Taking out any skip expression does return the data - although I've used this before and it worked great. Same file type, same headers to the data set, but different result?

  • MattCB Profile Picture
    14 on at
    Re: Apply_to_each is bypassed

    I've added that in but still the Apply_to_each doesn't fire.

  • Pstork1 Profile Picture
    67,060 Most Valuable Professional on at
    Re: Apply_to_each is bypassed

    I would put a compose in just prior to the Apply to each set to

    skip(outputs('Compose'),1)

    I suspect Compose is returning an array of length 1.  When you skip the first element you are ending up with an empty array.  That suggests the input document isn't finding the %0D%0A (carriage return and linefeed).

  • Pstork1 Profile Picture
    67,060 Most Valuable Professional on at
    Re: Apply_to_each is bypassed

    I would put a compose in just prior to the Apply to each set to

    skip(outputs('Compose'),1)

    I suspect Compose is returning an array of length 1.  When you skip the first element you are ending up with an empty array.  That suggests the input document isn't finding the %0D%0A (carriage return and linefeed).

  • MattCB Profile Picture
    14 on at
    Re: Apply_to_each is bypassed

    Thanks @Pstork1 - I've just updated the post with additional information.

     

    Apply_to_each is:
    skip(outputs('Compose'),1)
     
    Compose 5:
    replace(item(),'    ',',')
     
    Compose 2:
    split(outputs('Compose_5'),',')
     
    It has run fine before - I've been able to check the outputs after the "Apply_to_each" is run and you're right, nothing there, but there's definitely outputs from "Compose". 
     
    All the variables intialised beforehand are appended to in the Apply to each.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1