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 / condition for To addre...
Power Automate
Suggested Answer

condition for To address from incoming email

(0) ShareShare
ReportReport
Posted on by 2,249
I have hard coded user in get user profile To action so my issue is when incoming email To address contains multiple email address then flow is not working as expected and what i mean is that i wan to filter remaining email addresses in incoming email other than Test1@test.com (As below) so how to check this logic in my below flow
 
Categories:
I have the same question (0)
  • Suggested answer
    NsL Coder Profile Picture
    475 Moderator on at
    Not completely sure what you are trying to do here. 
     
    Assuming you are trying to "Get user profile To" for all email address that came in from the incoming email, then you just need to "split" the "to" dynamic content. (Assuming it is split by semi-colon, you can do split(triggerOutputs()?['body/toRecipients'], ';'), which will give you an array of all email addresses.
     
    Then you can Apply to each of the email to put into your Get user profile To action. However you want to handle the array will depend on your logic for the flow.
  • Suggested answer
    AnthonyAmador Profile Picture
    2,557 Moderator on at
    To extract the specific email Test1@test.com from a string using Power Automate, you can use the substring and indexOf functions.

    Here’s an expression that should help you achieve this:
    substring(variables('yourString'), indexOf(variables('yourString'), 'Test1@test.com'), length('Test1@test.com'))
    Here’s a breakdown of what this expression does:
     
    1. indexOf(variables('yourString'), 'Test1@test.com'): Finds the starting position of the email Test1@test.com within your string.

    2. substring(variables('yourString'), start, length): Extracts the substring starting from the position found in step 1, with the length of the email.

    Make sure to replace variables('yourString') with the actual variable or string that contains your emails.

    Hope this helps. 
    Anthony. 
     
    If my reply answers your question, please like and mark it as verified. This helps me stay motivated to assist others and makes it easier for users with similar questions to find the answer. Thanks!
     

    Feel free to connect with me on LinkedIn!
     
  • Veblitz Profile Picture
    2,249 on at
    here is the thing im trying to achieve
     
    1.When incoming email arrives To address recipient is ABC@hpl.xx and we need to extract this recipient user profile country details by using get user profile TO 
     
    But issue is sometimes users were specifying cc recipients addresses in To address so we need to check in flow that if abc@hpl.xx country details from get user profile to retrieved
     
    so kindly let me know if you need more details
  • Veblitz Profile Picture
    2,249 on at
    Thanks for the below idea:
    Assuming you are trying to "Get user profile To" for all email address that came in from the incoming email, then you just need to "split" the "to" dynamic content. (Assuming it is split by semi-colon, you can do split(triggerOutputs()?['body/toRecipients'], ';'), which will give you an array of all email addresses.
     
    Then you can Apply to each of the email to put into your Get user profile To action. However you want to handle the array will depend on your logic for the flow.
     
    So,as per your above details i perform below things
     
    1.Get user profile To-All email address that came in from the incoming email
    2.using compose action, i put this split(triggerOutputs()?['body/toRecipients'], ';')
    3.Apply to each of email array 
     
    after which i need to apply filter for this specified email address recipient is ABC@hpl.xx then i need to get user profile for this recipient is ABC@hpl.xx  country property dynamic value 
     
    something like this
     
  • NsL Coder Profile Picture
    475 Moderator on at
    You are still not clear on what you want done. I read it 3x and still don't understand you.
     
    You are monitoring a certain shared mailbox: mailbox@orgname.org
    So meaning new email received will have "to" mailbox@orgname.org in it (otherwise the email wouldn't have come to mailbox@orgname.org)
    The received email is "from" someone from.somebody@orgname.org 
    The received email may have additional user email address in the "to". another.to@orgname.org
     
    Are you trying get user profile (to get country) of:
     
  • Veblitz Profile Picture
    2,249 on at
    Thanks a lot its working fine

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 816

#2
Valantis Profile Picture

Valantis 603

#3
Haque Profile Picture

Haque 566

Last 30 days Overall leaderboard