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 / Remove [ ] Brackets fr...
Power Automate
Answered

Remove [ ] Brackets from single object array

(1) ShareShare
ReportReport
Posted on by 1,278 Super User 2024 Season 1

Hello, 

 

I have the follwing array which I get from a SQL import, filtered and is now a single object array. It is stored like this in a compose action: 

[
{
"ShipmentNumber": "1005",
"Analysis1": 23,
"Analysis2": 135655,
"Analysis3": null,
"Analysis4": 0,
"Analysis5": "10",
"Analysis6": "7"
}
]

 

I would like to remove the brackets [ ] from the start and end of the array, since these are creating some issues and using the values further. I would like to have the array in the exact same format. 

 

I tried the follwing: 

 

replace(replace(outputs('withBrackets'), '["', ''), '"]', '')

 

But I get the follwing errormsg: 

 

Heartholme_1-1641556052018.png

 

Any help would be really appriciated. 

 

Categories:
I have the same question (0)
  • Verified answer
    abm abm Profile Picture
    32,985 Most Valuable Professional on at

    Since its an array you need to convert to string()

     

    Try the following

     

    replace(replace(string(outputs('Compose')),'[',''),']','')
  • Heartholme Profile Picture
    1,278 Super User 2024 Season 1 on at

    @abm 


    Thanks a lot, I learned something new.

  • letsflow Profile Picture
    4 on at

    Hello,

    I am running into the same issue. 

    I am trying to avoid using substring as it converts the array to a string and adds additional \ which I am unable to remove when using an append-to-string action. 

    Is there a way to:

    A) remove the array [] without converting to string, OR

    B) remove \ from a string? (I have tried the following:

                      replace(output('actionname'),'\','')

                      replace(output('actionname'),'\\','')

                      replace(output('actionname'),'\"','"') 

    but none of the worked.

    Thanks in advance.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I am having the same issue. Need a way to remove the square brackets without it adding backslashes. I've tried this into an array variable, which works but it cuts the dataset to a single array (from multiple): array(json(replace(replace(string(outputs('Merged_Data')),'[',''),']',''))). I think I need a way to convert it back to Json without cutting the dataset.

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 464

#2
Haque Profile Picture

Haque 431

#3
David_MA Profile Picture

David_MA 323 Super User 2026 Season 1

Last 30 days Overall leaderboard