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

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / extract 4 consecutive ...
Power Automate
Suggested Answer

extract 4 consecutive digits

(1) ShareShare
ReportReport
Posted on by 12

Hello

I want to extract 4 consecutive digits (if there are more than 4 digits, I'm not interested), like in this example.

This is my text:
L,:OOULL (1 Job: 610799345 :awFCCCC S/:ORRTTP Or/:2432 OO MORGYAN .
(The text changes all the time)

 

Is there a way to extract only 4 consecutive digits and clean everything else?

Thank you

 

 

Categories:
I have the same question (0)
  • Suggested answer
    trice602 Profile Picture
    15,329 Super User 2025 Season 2 on at
    extract 4 consecutive digits
    Hi there!
     
    Guessing exactly what you were looking for but based on your text, I only see one 4 digit number so assuming you wanted to exact 2432???
     
    First I split on ":"
     
    split(outputs('Compose_text_input'),':')
     
    Next I get the first 4 digits in [5]
     
    substring(outputs('Compose_split')[5],0,4)
     
    From here, I check if the value is an integer and it will return true or false.
     
    isInt(outputs('Compose_substring')) 
     
     

    ------------------------------------------------

     

     

    ⭐ If this was helpful, please like and check the box below "Does this answer your question" to help others find this too!

     

     

    Always glad to help! 💯💯💯💯💯

     

    Tom

     

    Follow me on LinkedIn - Thomas Rice, PMP | LinkedIn

     
     
     
  • Michael E. Gernaey Profile Picture
    52,944 Super User 2025 Season 2 on at
    extract 4 consecutive digits
     
    Just to add in case @trice602 needs to show how to grab more than 1, is it just the one possible all the time, or can it have more than 1?

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard