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

Notifications

Announcements

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 38
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,129 Super User 2025 Season 2 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

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
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard