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 / Using trigger conditio...
Power Automate
Unanswered

Using trigger conditions with new email event

(0) ShareShare
ReportReport
Posted on by 8

I'm trying to understand how trigger conditions are used. I am working with a simple example where the event that triggers the flow is a new email with attachments, and I want to use a trigger condition so the flow only starts if the email's subject contains a certain word. The attachments are then saved in a SharePoint folder.

ramasaurio_1-1704982175316.png

It's suggested in the documentation, that I create a "Filter Array" action after the trigger, set the condition, and then extract the condition command and paste it into the trigger condition field in the trigger. So I do this:

ramasaurio_2-1704982397665.png

and then delete the Filter Array, and do this:

ramasaurio_3-1704982462439.png

When I save, I get an error saying that the trigger has invalid expressions for input parameters. I assume it's { } because if I remove them and instead of item I put triggerOutputs or triggerBody, it let me save, but when I test the flow, the error I receive is that the value of the first arguement of contains is Null.

ramasaurio_4-1704984198691.png

 

In the end what I'm asking is, how to access the element "subject" (or any other like sender, etc) from this trigger? And how the output being an array of emails (of one element, as I understand) affect the method to access the field?

Thanks a lot in advance.

 

PS. I know the Trigger has a "subject" field that I can use to do the same, I'm just exploring how should I work with trigger conditions.

 

 

Categories:
I have the same question (0)
  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    @ramasaurio If you are going to use the Filter Array action to compose your trigger you have to ensure it's outside of the Apply to Each action. 

     

    There seems to be a bug as I was unable to insert the Body output from the flow trigger into the Filter Array—which is why I used a Compose action to store that dynamic content.

    creativeopinion_0-1704987559538.png

    This is the expression:

    @contains(triggerOutputs()?['body/subject'], 'hello')

    creativeopinion_2-1704987604277.png

    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution ✅.
    Consider giving me a 👍 if you liked my response! 

    👉 Watch my tutorials on YouTube
    👉 Tips and Tricks on TikTok

    For more flow troubleshooting tips—check out this YT Tutorial: 5 Power Automate Troubleshooting FAQs and Helpful Tips for Creating Better Flows

    In this tutorial I cover:

    ✅ How to troubleshoot a false Condition action result

    ✅ How to get dynamic content when it isn’t selectable from the list of dynamic content

    ✅ How to troubleshoot an Apply to Each action that isn’t looping through

    ✅ How to troubleshoot a skipped Apply to Each action

    ✅ How to troubleshoot a Filter Query

    ✅ How to use a SharePoint yes/no column in a Filter Query

    ✅ How to use Compose actions to troubleshoot a Power Automate flow

    ✅ How to troubleshoot multiple emails being sent

    ✅ How to troubleshoot multiple Teams messages being sent

     

  • ramasaurio Profile Picture
    8 on at

    Thanks for your reply.

    Unfortunately, that's one of the options I already tried, and it gives the same error about the value being Null. The output is different to the one I showed on the original post, though.

     

    ramasaurio_0-1704988227998.png

     

  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    @ramasaurio It looks like you started editing your flow in the New Designer then switched over to the Classic Designer. If that is the case, can you try to create a new flow and switch over to the Classic designer before you start editing your flow. The New Designer has some bugs still. 

     

    Can you confirm the expression that you are using in the Trigger Condition?

  • ramasaurio Profile Picture
    8 on at

    That is correct. When I click on the "check error" link, it send me to the classic designer from where I extract the info I attached on my previous post. But all the editing and the testing of the flow I do it in the new designer.

     

    ramasaurio_0-1704991836422.png

    this is the trigger condition I'm using.

    This time I edited and tested the flow in the classic designer:

    ramasaurio_1-1704992362746.png

     

    and this is the error I'm getting. I think it's the same error but the output is different, there's no value now and only "headers".

    Thank you again for your help.

     

     

  • VictorIvanidze Profile Picture
    13,073 on at

    Just don't use the new designer at all.

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