web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Apply_to_each is bypassed
Power Automate
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'),',')

 

 

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    The results of the run suggest that the apply to each is running on an empty array. What array of values are you running the loop on?  I would double check again that the array actually contains data.

  • MattCB Profile Picture
    14 on at

    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.
  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    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
    68,697 Most Valuable Professional on at

    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

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

  • MattCB Profile Picture
    14 on at

    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

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

  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    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

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

  • MattCB Profile Picture
    14 on at

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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard