Skip to main content

Notifications

Power Automate - Using Flows
Suggested answer

condition for To address from incoming email

(0) ShareShare
ReportReport
Posted on by 2,185
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
 
  • Veblitz Profile Picture
    Veblitz 2,185 on at
    condition for To address from incoming email
    Thanks a lot its working fine
  • NsL Coder Profile Picture
    NsL Coder 465 on at
    condition for To address from incoming email
    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
    Veblitz 2,185 on at
    condition for To address from incoming email
    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
     
  • Veblitz Profile Picture
    Veblitz 2,185 on at
    condition for To address from incoming email
    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
  • Suggested answer
    AnthonyAmador Profile Picture
    AnthonyAmador 2,524 on at
    condition for To address from incoming email
    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!
     
  • Suggested answer
    NsL Coder Profile Picture
    NsL Coder 465 on at
    condition for To address from incoming email
    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.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard

Featured topics

Restore a deleted flow