Skip to main content

Notifications

Community site session details
Power Automate - Building Flows
Answered

Remove [ ] Brackets from single object array

Like (1) ShareShare
ReportReport
Posted on 7 Jan 2022 11:49:49 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. 

 

  • Verified answer
    abm abm Profile Picture
    32,464 Most Valuable Professional on 07 Jan 2022 at 11:56:47
    Re: Remove [ ] Brackets from single object array

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

     

    Try the following

     

    replace(replace(string(outputs('Compose')),'[',''),']','')

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,743 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,079 Most Valuable Professional

Leaderboard
Loading started
Loading started
Loading complete