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 Automate
Answered

Trim output

(0) ShareShare
ReportReport
Posted on by 185

Hi all,

 

I have a Filter array action and this is the output

 

[
 {
 "Url": "en/finance/employees/payrecords"
 }
]

 

How would I create a compose or variable action so I just have what's between the quotation marks, so effectively:

en/finance/employees/payrecords

 

I was trying something like this

 

Trim(Substitute(Replace(FilterArrayOutput, "[", ""), "]", ""), "{}", "") // Removes square brackets and curly braces
Replace(FormattedOutput, """", "") // Removes quotation marks
Substitute(FormattedOutput, ":", "") // Removes colons


Thanks,

David

Categories:
  • Verified answer
    v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @da1vea ,

    Please try this expression:

    split(split(string(body('Filter_array')),':"')[1],'"}')[0]

    Best Regards,

    Sunshine Gu

  • Verified answer
    Chriddle Profile Picture
    8,729 Super User 2026 Season 2 on at

    Do not use string functions on objects or arrays for this!

     

    Here is the correct way:

    Chriddle_0-1714142847241.png

     

     

    first(body('Filter_array'))['Url']

     

     

     

  • Chriddle Profile Picture
    8,729 Super User 2026 Season 2 on at

    Just seen, too complex 😂🤣😂

    Chriddle_1-1714143774860.png

     

     

  • da1vea Profile Picture
    185 on at

    Thanks @Chriddle ,

     

    Much simpler 🙂

     

    Earlier I had tried

     

    first(body('Filter_array'))?['Url']

     

    The question mark got me

  • Chriddle Profile Picture
    8,729 Super User 2026 Season 2 on at

    That should have worked too.
    The purpose of the question mark is to return null if the object does not have a 'Url' property.
    Without it, a flow error will occur in this case.

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
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard