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 / Replace on the first o...
Power Automate
Answered

Replace on the first occurance of a text

(0) ShareShare
ReportReport
Posted on by 1,849 Season of Giving Solutions 2025

I have a variable named listname and i want to remove this list name from the FullPath property. but i only want to remove the first occurrence of the list name. i mean if the list name if part of the item name i do not want to remove , i only want to remove the list name which comes at first. any advice how i can modify the built-in Replace() to only work on the first occurrence?

Thanks

Categories:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @johnjohnPter ,

     

    Please try this

    vxiaochenmsft_0-1718672842698.png

    indexOf(variables('originalString'), 'ABC')
    concat(substring(variables('originalString'), 0,outputs('Compose')),'',substring(variables('originalString'), add(outputs('Compose'), length('ABC'))))
     
    vxiaochenmsft_1-1718672871293.png

     

    Best Regards,

    Wearsky

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard