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 / How to extract text in...
Power Automate
Answered

How to extract text inside brackets then add them to variables

(0) ShareShare
ReportReport
Posted on by 6

Hi guys!

Currently stuck with this problem



I have a compose that outputs this text

07/12 [PROCESS 1][PROCESS 2][LOCATION][DESCRIPTION][TITLE NUMBER]

I want to extract the first 5 characters as date and extract the text inside the brackets and add them to a variable. I have variables initialized at the start of the workflow

{

Date = first 5 characters

firstProcess = text inside [process 1]

secondProcess = text inside [process 2]
location = text inside [location]

}

 

so on and so forth.

Thanks in advance for the help!

Categories:
  • Verified answer
    VictorIvanidze Profile Picture
    13,083 on at

    Split  the string using [ as a delimiter.  Replace all ] with nothing.

  • mikecen Profile Picture
    6 on at

    Thank you so much @VictorIvanidze! I got the output I was looking for!

    Last question would be, how do I put them into their own variables?

  • VictorIvanidze Profile Picture
    13,083 on at

    In the "Initialize variable" or "Set variable" use variables('ArrVar')[0] , variables('ArrVar')[1] etc

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

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 302 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 263

#3
Henil Profile Picture

Henil 115

Last 30 days Overall leaderboard