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 / Need help with replaci...
Power Automate
Answered

Need help with replacing string, please!

(0) ShareShare
ReportReport
Posted on by 22

Hello, 

I want to replace the string "2 is greater than 1" with given array { 1:one, 2:two }.

min_thein_0-1650899194879.pngmin_thein_1-1650899216782.pngmin_thein_2-1650899238653.png

 

But when I use replace expression using "Apply to each" step, the output is generated as 2 times.

min_thein_3-1650899264316.png

min_thein_4-1650899278522.png

 

Instead what I want is 1 time like this: "two is greater than one".

Can you help me please?

 

Best,

 

Min

Categories:
  • Verified answer
    DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @min_thein 

     

    You can try the following.  Note I have put the string into a variable. I love using compose but for this solution you need a variable as you need to update the value stored.  You cannot use concurrency either, so do not enable that on the apply to each.  A compose is needed in the apply to each as you cannot self reference a variable when overwriting.  

     

    DamoBird365_0-1650911091987.png

     

    Outside of the apply to each, if you use the variable in a compose, you get the updated string....

    DamoBird365_1-1650911184734.png

     

    History output:

    DamoBird365_2-1650911206791.png

     

    Damien

     

    Please take a look and subscribe to my YouTube Channel for more Power Platform ideas and concepts.  Thanks

  • min_thein Profile Picture
    22 on at

    Hi @DamoBird365,

     

    It’s perfect and thank you  very much for your detailed explanation. 

    Regards,

     

    Min

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 355

#2
11manish Profile Picture

11manish 336 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard