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 / Substring to remove st...
Power Automate
Unanswered

Substring to remove starting from "@" characters till the end from the emails

(0) ShareShare
ReportReport
Posted on by 1,710

Hello,


I would like to remove from the email form everything after the "@" characters either the "@" character will be removed to display only the User Name.

For example, let's suppose I have those two following users:

 

 

julientesting@microsoft.com
testing1234@onmicrosoft.com

 

 

The output result will be after using the substring expression:

 

 

julientesting
testing1234

 

 

Capture3.PNG

What would be the substring expression for the "FROM" dynamic content in the compose action to get the length of the elements dynamically to achieve the following scenario?

Can please someone explains in detail and provide an example?

 

Any help will be greatly appreciated.
Thank you!

Categories:
I have the same question (0)
  • ChristianAbata Profile Picture
    8,951 Most Valuable Professional on at

    hi @Julien2  you can use split like this

    first(split(THIS IS YOUR MAIL VALUE,'@'))

     

    first(split(outputs('Compose'),'@'))

    compose.PNG 

  • EBMRay Profile Picture
    1,710 on at

    Hi @ChristianAbata ,

     

    Thank you for your reply.

    One more thing if the email contains the following characters "-" or "_" or "." before the "@" is it possible to replace them with space only?

    For example:

    Julien.Test@microsoft.com
    Julien-Testing@onmicrosoft.com

    So the output result will be:

    Julien Test
    Julien Testing

     

    Looking forward to your response.

    Thanks again!

  • ChristianAbata Profile Picture
    8,951 Most Valuable Professional on at

    Sure you can use this fuction.

     

    replace(outputs('Compose_2'),'.',' ')

    replace(VALUEWITHDOT,'.',' ')

     

    where compose 2 is the value of your email with . for example christian.abata, then the special character an the the withe space that is going to replace dot.

     

    Hope you this helps you, please don't fotget to mark as a solution to the other ousers.

  • EBMRay Profile Picture
    1,710 on at

    Hi @ChristianAbata,

     

    Great, but not all the emails are the same and got "." character some emails might have "-" and "_" characters.
    What you mentioned it will only replace "." with space let's say that the result of compose_2 is Christian_abata so the name will remain the same because the "." does not exist.

     

    Is it possible to check if the email got any of those characters, directly replace them with space in the same expression?

     

    Thank you!

     

  • ChristianAbata Profile Picture
    8,951 Most Valuable Professional on at

    Sure you can @Julien2  you need to create an array list of special characters.

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard