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 / trim or replace variable
Power Automate
Answered

trim or replace variable

(0) ShareShare
ReportReport
Posted on 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

Categories:
I have the same question (0)
  • Verified answer
    abm abm Profile Picture
    32,985 Most Valuable Professional on at

    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|','')
     
     
     

     

     

  • abm abm Profile Picture
    32,985 Most Valuable Professional on at

    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
  • KvB1 Profile Picture
    1,596 on at

    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

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 608

#2
Valantis Profile Picture

Valantis 416

#3
11manish Profile Picture

11manish 348

Last 30 days Overall leaderboard