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 / search a Trigger Condi...
Power Automate
Unanswered

search a Trigger Condition to recognize that the EMAIL is a calendar entry

(0) ShareShare
ReportReport
Posted on by 13

I have a trigger that detects whether a new email has arrived in a shared mailbox. However, this trigger should only activate if the email is not an invitation to an appointment.

I have already tried the following two approaches, 

not(contains(triggerOutputs()?['body'], 'BEGIN:VCALENDAR'))
and
not(contains(triggerOutputs()?['headers']['Content-Type'], 'text/calendar'))

 but I get an error when saving:

The power flow's logic app flow template was invalid. The template condition expression 'not(contains(triggerOutputs()?['body'], 'BEGIN:VCALENDAR'))' at line '1' and column '3557' is not valid template language expression.

same by Using Content-Type

How can i solve my problem?
Thank you for your help.

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at

    Hi @fraenkers,

     

    A couple of things to double check.

     

    1. Did you use an '@' at the beginning of your trigger condition? A trigger condition always starts with the '@' character. 

     

    2. You want to check if the body of the message contains BEGIN:VCALENDER, correct? In that case use the body/body instead.

     

    Can you try this expression instead?

    I also changed the format of the and function, I placed it at the beginning.

     

    @and(not(contains(triggerOutputs()?['body/body'], 'BEGIN:VCALENDAR')), not(contains(triggerOutputs()?['headers']['Content-Type'], 'text/calendar')))

     

     

    andfunction.png

     

     

  • fraenkers Profile Picture
    13 on at

    G - I'M so stupid 😄 sorry - perhaps this is the problem - i will check this later

  • fraenkers Profile Picture
    13 on at

    Hello,

    Thank you very much for your comments.
    The mistake was indeed just eliminated by adding the @.

    However, it's not working as it should, and I don't know why.

    Even the example from @Expiscornovus doesn't work as desired.
    So, as correctly identified, the Flow should send an autoresponder for every incoming EMAIL in a group mailbox, except if it's a calendar entry.  

    In the meantime, I've also tried this: 

    @not(or(contains(triggerOutputs()?['headers']['Content-Type'], 'text/calendar'), contains(triggerOutputs()?['body'], 'Content-Type: text/calendar')))
    and
    @not(or(contains(triggerOutputs()?['headers'],'Content-Type: text/calendar'), contains(triggerOutputs()?['body'], 'Content-Type: text/calendar')))

    But that also doesn't work - the sender recived an autorespnse for a Invitation.
    But, the text phrase "Content-Type: text/calendar" is so clearly in a calendar entry. Do you have any other ideas on how I can solve this?

    Many thanks.

  • Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at

    Hi @fraenkers,

     

    Can you share the outputs of the trigger action from one of the flow instances which was triggered by one of the appointment e-mails which you want to ignore? This will help determine the trigger condition we need.

     

    Btw, did the example I shared give an error. Or do you mean it does not work in the sense that some e-mails still trigger the flow, which should not?

  • fraenkers Profile Picture
    13 on at

    Hello @Expiscornovus 

    I apologize for the long gap in communication. I had replied to you, but the message seems to have disappeared. I'm not sure what happened there.

    Attached are the details you requested. I believe I've identified the issue: the trigger conditions "@and(not(contains(triggerOutputs()?['body/body'], 'BEGIN:VCALENDAR')), not(contains(triggerOutputs()?['headers']['Content-Type'], 'text/calendar')))" are not applicable here because neither condition is met, even though I'm not sure why that is the case. It looks like I'll have to explore alternative solutions.

    On a positive note, your approach was correct; there are no longer any errors. The only issue is that it's not producing the outcome I had hoped for

    Best regards
    Frank

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