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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Microsoft Flow is not working with filter expression

(0) ShareShare
ReportReport
Posted on by 327

Hello,

I am creating flow to create a case when we receive an email in shared mailbox using custom flow. I want to trigger a flow based on filter expression because I do not want unnecessary triggers for flows. I want to trigger a specific flow so I have added condition to check subject of email like To check "cancel" or "order" keyword of email subject.

On create or update of email...

Filter Expression = contains(subject,'%cancel%').  IF email subject contains "cancel" keyword then trigger a flow.

The above condition is not working. It's not triggering a flow. I have used xrmtoolbox to copy expression but still it's not working for me as per this video : 

https://www.youtube.com/watch?v=U_hXOFokymg

pastedimage1609751907154v1.png

Could you please help me on this.

Thanks

Pradip

I have the same question (0)
  • Suggested answer
    Rodrigo Hentz Profile Picture
    on at

    Hi Pradip how are you?

    Pradip, did you try to use only contains(subject, 'cancel') ?

    I mean, without the % character.

    Please let me know if this information helped on your question.

     

    Regards.

    Rodrigo Hentz

    Microsoft Support Engineer

  • Pradip Raj Profile Picture
    327 on at

    Hi Rodrigo,

    I am good. thanks. you?

    I have tried all the possible combinations including trigger conditions from settings but it's not working for me.

    Thanks

    Pradip

  • Suggested answer
    Rodrigo Hentz Profile Picture
    on at

    I did a small test on my organization and the filter expression is ok. Maybe you have to remove the filtering attributes.

    If the importsequencenumber is not changed the flow will not run.

    My sample:

    pastedimage1609852645928v2.png

    pastedimage1609852578759v1.png

    Please let me know if this information helped on your question.

     

    Regards.

    Rodrigo Hentz

    Microsoft Support Engineer

  • Pradip Raj Profile Picture
    327 on at

    Hi Rodrigo,

    I have removed filtering attributes and now it's working for me. Thank you for this.

    But I found that it is a case sensitive. For Example, I have check for contains(subject, 'cancel')  and if I send email with subject "Cancel" then it won't work.  Is their any workaround to achieve this.?

    Thanks

    Pradip

  • Verified answer
    Rodrigo Hentz Profile Picture
    on at

    Hi Pradip sorry for the delay to answer.

    You can use tolower expression like my sample below. 

    contains(tolower(subject), 'cancel')

    pastedimage1610056047518v1.png

    Please let me know if this information helped on your question.

     

    Regards.

    Rodrigo Hentz

    Microsoft Support Engineer

  • Suggested answer
    Pradip Raj Profile Picture
    327 on at

    Hi Rodrigo,

    Thank you very much for this. This is working like a charm.!!

    Yesterday, I tried this "toLower" function but it didn't work for me because of syntax - "toLower". "toLower" is not working in filter expression with "When a record is created, updated or deleted". Even in Microsoft doc and other community blogs the syntax is "ToLower" - docs.microsoft.com/.../workflow-definition-language-functions-reference which is not working with filter expression.

    "tolower" is working fine with filter expression. Syntaxt are as below : 

    pastedimage1610073155612v1.png

    Previously we tried the below "or" operator and it was working fine for me but it's case sensitive.

    contains(subject,'CANCEL') or contains(subject,'Cancel') or contains(subject,'cancel')

    Save my lots of time. Thank you again Rodrigo.

    Thanks

    Pradip

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 41 Most Valuable Professional

#2
iampranjal Profile Picture

iampranjal 39

#3
Satyam Prakash Profile Picture

Satyam Prakash 35

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans