Skip to main content

Notifications

Community site session details
Power Automate - Building Flows
Answered

Removing brackets from a Compose Output

Like (0) ShareShare
ReportReport
Posted on 9 Mar 2021 11:03:19 by 7

Hi.

 

Basically I am trying to get entries from multiple SharePoint lists and join them all together in an XML file. 

 

Get items from list 1.

Apply to Each list 1 - this gets the Title from each list item.

Compose 1 - put Title inside the XML elements.

 

Get items from list 2

Apply to Each list 2

Compose 2

 

I then have a final Compose that puts  Outputs 1 and 2 inside the XML headers. 

I end up with all the XML  I want but it  also includes square brackets.

 

<?xml version="1">

<element>

[" <element2>title1</element2>"]

["<element2>title2</element2>"]

</element>

 

Is there any way to prevent or remove these square brackets? 

  • tinyellie Profile Picture
    7 on 09 Mar 2021 at 14:38:25
    Re: Removing brackets from a Compose Output

    I had to initialize a variable to turn the array output into a string and then it worked. Thank You! 

  • Verified answer
    Paulie78 Profile Picture
    8,407 Super User 2025 Season 1 on 09 Mar 2021 at 11:53:15
    Re: Removing brackets from a Compose Output

    In a compose action:

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

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

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

Leaderboard > Power Automate - Building Flows

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 200 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 192 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 177

Overall leaderboard
Loading started
Loading started