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 / Read text between "[" ...
Power Automate
Answered

Read text between "[" and "]" characters

(1) ShareShare
ReportReport
Posted on by 40
Hello,
I receive an email with the default subject "Price Ind | 04/Oct/2024 | ID [17]"

How can I read the text between the characters "[" and "]" and store it in a variable?

In the example above, Automate should store the value "17" inside a variable.
Categories:
I have the same question (0)
  • claudiovc Profile Picture
    94 on at
    HI.
     
    Please try this
     
    split(split(outputs('subject'),'[')[1],']')[0]
     
    I hope it helps!
  • Verified answer
    Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at
    Hi,
     
     
    Answers provided by @claudiovc is correct, in addition you can try below approaches :)
    2 ways you can try :
     
    1. String manipulation.
     
     
    Expression - 
    slice(outputs('Compose'),add(indexOf(outputs('Compose'),'['),1),indexOf(outputs('Compose'),']'))
     
     
    Output you will get : 
     
     
    2nd approach- (quite advanced and using regex)
     
    Here this method is optional and you can use regular expressions to capture the details present b/w []. for this you need to write an office script and run that script using power automate, see below
     
    This article explains how to use regex pattern to get details.
     
    in your case- regex pattern should be: (?<=\[).*(?=\])
     
     
    Hope it helps !
     
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs
     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. Thank you!

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 245

#2
David_MA Profile Picture

David_MA 216 Super User 2026 Season 1

#3
Valantis Profile Picture

Valantis 212

Last 30 days Overall leaderboard