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 : efszQ8STKtEKE6tbrif3eA
Power Automate - Building Flows
Answered

trim or replace variable

Like (0) ShareShare
ReportReport
Posted on 6 Apr 2022 12:47:48 by 443

Hallo,

 

i am setting a variable initialized as array. The value i am getting is

 

[

{

"EMail": "myEmail@demo.com",

"Title":"my Email",

"Name":"i:0#.f|membership|mymail@demo.com"

},

{

"EMail": "mySecondEmail@demo.com",

"Title":"my Second Email",

"Name":"i:0#.f|membership|mysecondmail@demo.com"

}

]

 

Is there a way i can trim the Name property so i can keep only the red highlighted value??

I only want mymail to be the Name property

  • KvB1 Profile Picture
    1,596 on 06 Apr 2022 at 13:19:04
    Re: trim or replace variable

    You can also use the select action and enter an expression in the value for Email field where you use a replace function, that way you can avoid the apply to each loop and keep your flow more efficient

  • abm abm Profile Picture
    32,506 Most Valuable Professional on 06 Apr 2022 at 13:09:40
    Re: trim or replace variable

    Hi @marial16 

     

    I have extended the flow to read the contents. Here it is

     

    image.png

    image.png

     

    Parse JSON Schema is as follows:

     

    {
        "type""array",
        "items": {
            "type""object",
            "properties": {
                "EMail": {
                    "type""string"
                },
                "Title": {
                    "type""string"
                },
                "Name": {
                    "type""string"
                }
            },
            "required": [
                "EMail",
                "Title",
                "Name"
            ]
        }
    }
     
    Here is my run result:
     
    image.png
     
    Above in my test I have mapped only one property (EMail) under the Apply to each loop. You can use EMail, Title or Name here.
     
    Thanks
  • Verified answer
    abm abm Profile Picture
    32,506 Most Valuable Professional on 06 Apr 2022 at 13:02:46
    Re: trim or replace variable

    Hi @marial16 

     

    Use the replace expression

     

    replace(string(outputs('Compose')),'i:0#.f|membership|','')
     
    image.png
     
    Expression I used above is
     
    replace(string(outputs('Compose')),'i:0#.f|membership|','')
     
     
     

     

     

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2