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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Apply To Each - Not wo...
Power Automate
Answered

Apply To Each - Not working as expected

(0) ShareShare
ReportReport
Posted on by 290

 

Hello All ,

 

I am really stuck here. Cant find help or resources on this.

My flow works successfully showing green ticks , but 

 

- no attachments on the email

- get attachment has [ ] body

- the contents of "apply to" is greyed out

 

apply to greyed.png

 

 

apply to greyed2.png

 

Kindly help mw with some direction

 

C1

 

Categories:
I have the same question (0)
  • tom_riha Profile Picture
    10,187 Most Valuable Professional on at

    Hello @cadone ,

    [] means that the action returned an empty array, no attachment was found at the item. And since there’s no attachment, the ‘Apply to each’ action doesn’t have anything to process. 
    Do you have attachment at the item? Do you have correctly configured the ‘Get attachments’ action?

  • cadone Profile Picture
    290 on at

    @tom_riha  Thanks a lot for looking into it. I am positive that there are attachments. I have manually opened & verified it opens. Screen shot of item info.

     

    cadone_9-1607790271132.png

     

    I am also positive that the get item is getting the right item.

    cadone_7-1607789042733.png

     

     

    My get attachment configuration :

    cadone_6-1607788986047.png

    configuration :

    cadone_8-1607789594260.png

     

    Thanks

    C1

     

     

     

     

  • Verified answer
    tom_riha Profile Picture
    10,187 Most Valuable Professional on at

    I don't see any problem in the flow, it seems completely fine. When you download the trigger output, does it contain 

    "{HasAttachments}": true

    I'd test the 'Get attachments' action by adding a fixed ID of the item instead of dynamic content, if it works that way. The problem will be somewhere between the item itself and the 'Get attachments' action, the whole 'Apply to each' section is irrelevant as long as it doesn't find any attachments.

  • cadone Profile Picture
    290 on at

    @tom_riha "{HasAttachments} : flase

     

    As suggested I passed a static # ( ID of item that failed). This one worked. Email success !!

    Was able to open the attachments.

     

    I only have " initialize variable" between the "when the item is created" & "get attachments".

    Do you think there could be issues with that? 

     

    Thanks

    C1

  • cadone Profile Picture
    290 on at

    although hardcoding ID in the "get attchments" worked; i cant understand the very first step (trigger).

    Why is the trigger output showing "HasAttachments"=False. This is not correct. I know for sure it has "attachments"

     

    How can I fix a Trigger to show HasAttachments=true? is this even possible?

  • tom_riha Profile Picture
    10,187 Most Valuable Professional on at

    Then either the trigger is somehow broken or the flow is accessing different items in the trigger / Get attachments. If the 'Site address' and 'List name' are the same in both of the actions, I'd try to delete the trigger and add it again.

    You can't force the trigger to change any value, it's taken from the item. If it recognizes attachments at the item, it'll show "HasAttachments"=true.

  • cadone Profile Picture
    290 on at

    @tom_riha 

    I tried deleting & adding the trigger. didn't help. Still shows false for HasAttachements.

     

    Alternatively i tried this workaround and it works. Although it works, I think I am not following a good method. 

     
    I passed triggerOutputs()?['body'].ID  to ID field of "get attachments" . This works. 
     
    Bottom of my heart says fix the error at the trigger than using this workaround. To fix the beginning of this flow "Trigger" of when an item is created; looks like I have to fix the first flow (previous flow for MS form to sharepoint) that actually creates the SharePoint item & adds the attachment. Just because I can physically see the attachments, doesn't mean the flow see it also. some thing must be wrong there in that flow. 

     

  • Verified answer
    cadone Profile Picture
    290 on at

    @tom_riha 

     

    Thanks for the tip you gave. Made me think that some thing must be wrong in the previous flow that actually create that item & adds the attachment.

     

    I modified that flow, which in turn fixed this flow. Now the trigger shows "HasAttachments" = true  🙂

     

    i want briefly explain what i fixed on my previous flow that creates item in SharePoint that this flow gets triggered from.

     

    its a flow that converts Form data to Share point item. Also include a excel file creation inside the same flow. To help excel file complete I use a "delay" action of 60sec between create item & add attachments to item.  I moved the create item, add attachments after the "delay"

     

    I think my second flow was getting triggered while the first flow was in delay stage.

     

  • tom_riha Profile Picture
    10,187 Most Valuable Professional on at

    Hello @cadone ,

    good job finding the problem. The flow was triggered on item create, so if you had a pause before adding the attachments then the flow triggered on the item without the attachments.

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 258 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 198 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 136 Super User 2026 Season 2

Last 30 days Overall leaderboard