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 / Trigger Condition that...
Power Automate
Answered

Trigger Condition that filters for a 10-digit integer?

(0) ShareShare
ReportReport
Posted on by 271

I'm building a Flow that triggers when an email is received but is sent as a SMS or MMS from a phone. The sender (From) appears as a 10-digit number plus the phone carrier code, e.g. "2025551212@vtext.com"

 

I want to add a trigger condition that only launches the Flow when the sender includes a 10-digit integer (but not a specific set of numbers). I'm thinking it should look something like

 

@contains(triggerBody()?['From'], XXXXX)  

but I have no idea how to characterize a 10-digit integer?

 

Any suggestions?

 

Categories:
I have the same question (0)
  • Verified answer
    fchopo Profile Picture
    8,003 Moderator on at

    Hi @MarcusD1 

    With the following expression you could check:

    1) If From field length before '@' is 10 digits.

    2) If this 10 digits are numbers, or at least, could be converted to integer value.

     

    The expression is the following:

    if(equals(length(substring(triggerOutputs()?['body/from'],0,indexOf(triggerOutputs()?['body/from'],'@'))),10),isInt(string(substring(triggerOutputs()?['body/from'],0,indexOf(triggerOutputs()?['body/from'],'@')))),false)

     

    a) Get 10 first digits before '@':

    substring(triggerOutputs()?['body/from'],0,indexOf(triggerOutputs()?['body/from'],'@'))

    b) Check if it is 10 digits:

    equals(length(substring(triggerOutputs()?['body/from'],0,indexOf(triggerOutputs()?['body/from'],'@'))),10)

    c) Check if it's an integer:

    isInt(string(substring(triggerOutputs()?['body/from'],0,indexOf(triggerOutputs()?['body/from'],'@'))))

     

    Mixing all expressions you can get that.

    Hope that helps!

    Ferran

  • Verified answer
    Ellis Karim Profile Picture
    11,793 Super User 2025 Season 2 on at

    Hi @MarcusD1 ,

     

    Extending what @fchopo has provided, you could also try the following trigger condition:

     

     

    @and(equals(length(first(split(triggerBody()?['From'], '@'))),10), isInt(first(split(triggerBody()?['From'], '@'))))

     

     

     

    • Get the text before the @ symbol in the From address,
    • the length of the string must be 10 characters
    • must be an Integer.


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

     

  • MarcusD1 Profile Picture
    271 on at

    Thank you @ekarim2020 and @fchopo ! Both solutions worked.

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 398 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 323 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 183 Most Valuable Professional

Last 30 days Overall leaderboard