web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Replace on the first o...
Power Automate
Unanswered

Replace on the first occurance of a text

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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard