Legacy Dev Forum Posts

 View Only

Sign Up

Check if a Flow variable of String has only numbers

  • 1.  Check if a Flow variable of String has only numbers

    Posted 06-05-2025 19:26

    Ajay_1019 | 2024-06-21 12:30:56 UTC | #1

    Part of the Architect flow, I need to check if a flow variable (string) has a phone number or extension digits. Basically, we need to check if the flow string has all the numeric characters? I searched for the functions like ToJason() / isJsonNumber() etc. but nothing worked.

    It is a simple language construct but I could not find a way to get this done in Architect. Thanks for any ideas on this and will be a great help..

    Thank you.

    Ajay


    SimonBrown | 2024-06-21 16:19:18 UTC | #2

    If you don't have a level of control over the string var to trust a ToPhoneNumber() then you can use the ToInt() function passing a default value, to prevent flow error handler, e.g. Then do a decision on it, or an expression directly with the example checking if == to 0 to follow a NotANumber route

    ToInt(MyStringVar,0)

    Ajay_1019 | 2024-06-21 17:12:41 UTC | #3

    Thanks for the quick response. I would check like this.

    ToInt(Flow.OptionalMessage, 0) != 0

    Then will transfer to a number.

    That should work. Thanks again.


    system | 2024-07-22 17:12:42 UTC | #4

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 26912