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 / Extract 6 digits from ...
Power Automate
Suggested Answer

Extract 6 digits from an email body & save to file

(0) ShareShare
ReportReport
Posted on by

I need to Extract 6 digits from an email body. ChatGPT has instructed me to use Compose with this input:

substring(body('Get_email')?['body'], indexOf(body('Get_email')?['body'], 'Your verification code is') + 25, 6)but when i open the file it just shows the code and not the 6 digits. Also willing to try in Desktop if it's possible

Categories:
I have the same question (0)
  • Suggested answer
    David_MA Profile Picture
    14,499 Super User 2026 Season 1 on at
    Based on your screen shot, you just wrote your expression in the Compose action. You need to use the expression builder to write the expression.  When you use the expression builder, it will show like this:
     
     
    Your expression is also not valid as "+" is not the expression to add in Power Automate. I think you are trying to get the next six characters after "Your verification code is" from a string. If so, you expression would be:
     
    substring(triggerBody()?['text'], add(int(indexOf(triggerBody()?['text'],'Your verification code is')), 26), 6)
     
     Replace the two highlighted portions with the value from the dynamic content picker that stores the value. I think you also need to add 26 instead of 25 to account for a space after the search string. If not, then you can adjust 26 to what works.
     

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 957

#2
Valantis Profile Picture

Valantis 847

#3
Haque Profile Picture

Haque 609

Last 30 days Overall leaderboard