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

Announcements

News and Announcements icon
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
    12,024 Super User 2026 Season 1 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 552

#2
Valantis Profile Picture

Valantis 388

#3
11manish Profile Picture

11manish 375

Last 30 days Overall leaderboard