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 / Workflow error trying ...
Power Automate
Suggested Answer

Workflow error trying to connect Graylog webhook

(0) ShareShare
ReportReport
Posted on by
The execution of template action 'Send_each_adaptive_card' failed: the result of the evaluation of 'foreach' expression '@triggerOutputs()?['body']?['attachments']' is of type 'Null'. The result must be a valid array.
Categories:
I have the same question (0)
  • Suggested answer
    Riyaz_riz11 Profile Picture
    3,891 Super User 2025 Season 2 on at
    HI,
     
    Wrap loop in a Condition
    Add a Condition before the “Send each adaptive card” action.
    Use expression:
    @and(
      triggerOutputs()?['body']?['attachments'],
      not(empty(triggerOutputs()?['body']?['attachments']))
    )
    Branch logic:
    If TRUE → proceed with Apply to each using body('trigger')?['attachments']
    If FALSE → skip sending cards or handle alternative path
    This ensures your loop only runs when there's actually an array.
     
     
    Option 2: Use coalesce() to ensure an array
    If you prefer a one-liner inside Apply to each:

    coalesce(triggerOutputs()?['body']?['attachments'], createArray())
    That ensures Power Automate always receives an array—even when attachments is null.
     
    If I have answered your question, please mark it as the preferred solution ✅ . If you like my response, please give it a Thumbs Up 👍.
    Regards,
    Riyaz
     

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard