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

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Replace values in an array

(0) ShareShare
ReportReport
Posted on by 27

Hi all,

I've created an array but need to replace its values with something else.

 

This is the array: ["mjz5lfmzksyt","c0ptfg87m6fk","ytnly15lk1l7","3v17wct4sb9l"]

 

The values to replace should always be the same, e.g. mjz5lfmzksyt always becomes TESTSETUP1 and so on.

 

Not sure how to do this best, so I am looking for some guidance.

 

Thanks!

 

 

I have the same question (0)
  • Verified answer
    Mira Ghaly Profile Picture
    11,409 Moderator on at
    Re: Replace values in an array

    @ThoSt 

    1. Create an Apply for each loop on the array 

    2. Then a switch condition on the array value for example:mjz5lfmzksyt 

    3. Then use compose data operation replace function to replace the value and add it to a new array

     

    Hope this gives you an idea!

  • Serbay Profile Picture
    213 on at
    Re: Replace values in an array

    Hi,

    You can use “replace” function to replace values.

     

    https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#replace

    Regards,

  • MayaD Profile Picture
    on at
    Re: Replace values in an array

    Hi@Mira_Ghaly 

    I am wondering if you can outline how this looks in a little more detail. I think this is what I need to resolve my current issue but I'm having a hard time visualising what this would look like in PowerAutomate.

    Thanks

  • hyperbob0811 Profile Picture
    91 on at
    Re: Replace values in an array

    @Serbay 

    you cannot use replace with an array - it works only on a string, I have tried this several times and get a workflow failure every time.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 614 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 401 Moderator

#3
chiaraalina Profile Picture

chiaraalina 282

Last 30 days Overall leaderboard