Skip to main content

Notifications

Community site session details

Community site session details

Session Id : oznS3slqnMNUd+eS1N0pFu
Power Automate - Building Flows
Answered

Condition for count of character in power automate flow

Like (0) ShareShare
ReportReport
Posted on 19 Mar 2024 15:05:11 by 56

Hello,

 

I have a flow that will run when the character starts with 0.

Is there a way to add a condition that will count the number of characters?

Thus, the flow will run only if the character starts with 0 and count of character is 15 digits.

 

GPT2_0-1710860589397.png

Thanks for anyone who can help.

  • GPT2 Profile Picture
    56 on 20 Mar 2024 at 00:34:20
    Re: Condition for count of character in power automate flow

    @creativeopinion  thank you very much for sharing your knowledge.A great help. my flow in now working.

  • Verified answer
    creativeopinion Profile Picture
    10,396 Super User 2025 Season 1 on 19 Mar 2024 at 17:32:34
    Re: Condition for count of character in power automate flow

    @GPT2 When you enter a number into the condition value field—it's viewed as an integer. To convert it to a string you need to use an expression and the string() function. Enter the value into the string() function. In your case, it's a 0. This expression will convert the integer to a string. 

     

    creativeopinion_0-1710869355675.png

    To count the length of characters in your string of text (Compose action with telephone number) you need to use an expression and the length() function.

    creativeopinion_1-1710869440522.png

    Click on the dynamic content and insert the output from the Compose action above. 

    creativeopinion_2-1710869465611.png

    creativeopinion_3-1710869493372.png

    Tip: You may want to add a Compose action above the Condition action instead to store the length(). Since the Condition action will not output the length anywhere for you to view. This can help with troubleshooting your flow as you can verify the output of the Compose action. I cover how to do this in the tutorial I linked previously. 

     

    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution .
    Consider giving me a 👍 if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram
  • GPT2 Profile Picture
    56 on 19 Mar 2024 at 16:54:55
    Re: Condition for count of character in power automate flow

    GPT2_0-1710866977153.png

    GPT2_4-1710867387408.png

     

     

    GPT2_2-1710867082733.png

    @creativeopinion Here,  I would like to send the email once it satisfy the condition (the tel number output start with 0 and the number length of character is 15 digits)

  • creativeopinion Profile Picture
    10,396 Super User 2025 Season 1 on 19 Mar 2024 at 16:43:11
    Re: Condition for count of character in power automate flow

    @GPT2 Could you share a screenshot of your full flow. It's hard to provide any recommendations when I've only seen a portion of the flow.

     

    The length of a string of text can be used in a condition. 

  • GPT2 Profile Picture
    56 on 19 Mar 2024 at 16:35:59
    Re: Condition for count of character in power automate flow

    @creativeopinion ,can the length of the character be used as a condition?I would like to add it below.

    GPT2_0-1710865622707.png

    Also when I try to run the flow below using the condition output starts with 0 I encounter an error

    GPT2_1-1710865958672.png

     

    Do you have any suggestion in order to run the flow that when the string starts with 0 and it has 15 character it will proceed to the next step?

     

    I am still exploring power automate and still many things to learn.

    Help is highly appreciated.

     

  • Verified answer
    creativeopinion Profile Picture
    10,396 Super User 2025 Season 1 on 19 Mar 2024 at 15:46:57
    Re: Condition for count of character in power automate flow

    @GPT2 If you are evaluating a string of text you can count the characters using an expression and the length() function.

     

    length([insert string of text])

     

    You might be interested in this YT Tutorial: 5 Power Automate Troubleshooting FAQs and Helpful Tips for Creating Better Flows

     

    IN THIS VIDEO:

     How to troubleshoot a false Condition action result

     How to get dynamic content when it isn’t selectable from the list of dynamic content

     How to troubleshoot an Apply to Each action that isn’t looping through

     How to troubleshoot a skipped Apply to Each action

     How to troubleshoot a Filter Query

     How to use a SharePoint yes/no column in a Filter Query

     How to use Compose actions to troubleshoot a Power Automate flow

    How to troubleshoot multiple emails being sent

     How to troubleshoot multiple Teams messages being sent

     

    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution .
    Consider giving me a 👍 if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,670 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard
Loading started
Loading complete