Power Automate when a new email arrives Subject Filter Wildcard

800 views Asked by At

I want to apply a subject filter with wildcard characters, I have tried the below expression.

@startswith(triggerOutputs()?['body/subject'], 'Doc*')

It is taking the 'Doc*' as a string value and not taking * as a wildcard character.

Is there any expression available for wildcard matching in Power Automate flow?

1

There are 1 answers

0
Sam Nseir On

To answer your question - there are no native string functions that support wild cards in Power Automate.

List of string functions: https://learn.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#string-functions

You could look into a combination of startsWith, endsWith, indexOf with and() to get similar results.

If you are using the Outlook connector, then there is a Subject Filter property that does support wild cards - see https://learn.microsoft.com/en-us/power-automate/email-triggers?tabs=classic-designer

There are some connectors or "workarounds" in having RegEx in Power Automate: