cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Trying to get first part of email address

Hi community,

 

Been struggling with trying to get the first part of a username where <username>@domain.com is the email address;

 

I have a Person field in SharePoint that allows me to use the field Requester Email (works fine when sending the email).

 

Im trying to save the username part of the email address so I can insert a separate internal domain to it so it I was looking to make 2 compose statements that captured the string before the '@' then I can append the other domain to it. So the end result would be username@internal.domain.com 

 

first(split(item()?['Requester']?['Email'],'@'))

 

Been trying a split but it keeps telling me that it is null. Also I'm not sure why the field appears to be split up with a ? between the 2 fields..

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User II
Super User II

Re: Trying to get first part of email address

Hi @Andrew260z1 ,

 

If you're getting null, probably the item()?['Requester']?['Email'] doesn't contain any email (for some reason). Can you check in your flow log if indeed there's an email there? You can do an "if" before to double-check that.

 

If the domain part is always the same, you can also use the following alternative:

 

replace(triggerBody()['text'],'yourdomain','internal.yourdomain')

 

Then you can do it in one "Compose" action.

 

Does this help you?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

 

View solution in original post

3 REPLIES 3
Highlighted
Super User II
Super User II

Re: Trying to get first part of email address

Hi @Andrew260z1 ,

 

If you're getting null, probably the item()?['Requester']?['Email'] doesn't contain any email (for some reason). Can you check in your flow log if indeed there's an email there? You can do an "if" before to double-check that.

 

If the domain part is always the same, you can also use the following alternative:

 

replace(triggerBody()['text'],'yourdomain','internal.yourdomain')

 

Then you can do it in one "Compose" action.

 

Does this help you?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

 

View solution in original post

Highlighted
Dual Super User III
Dual Super User III

Re: Trying to get first part of email address

Hey @Andrew260z1 

 

Can you share a screenshot of the flow? Just want to check from what action you are referencing the value (and basically the attribute that you are referring to from the dynamic selector). 

 

Referencing the wrong attribute in the expression might be a reason this is failing. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted
Frequent Visitor

Re: Trying to get first part of email address

You post helped me find a solution, became 4 compose statements in the end. I think the dynamic field cannot return a value since itself is a query. So needed to capture that as a string first then from there do the first and split statement then create another compose with the @internal.domain.com and the 4th one concats both those values together. 

 

If there is a shorter way to achieve this.. let me know.

 

Thanks!

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (5,004)