How to search a specific email and forward it to specific recipients in Outlook?

Dear Experts

I have a outlook request as below, pls help show me some guidance to make it happen:

  1. Use [for each] activity to copy each [Order Number] in excel file
    image

  2. Search it in specific outlook mail folder(There will be ONLY 1 email to be found after search)


    2-1) IF there is no relative email found, move to next [Order Number]

  3. Open the found email and forward to appointed recipients according to the excel file
    image

image

image

Thank you for your advise in advance

Ivan

@yangyq10,

Use this approach,

  1. Use For Each activity to iterate through all the Order number you have.
  2. Use Get Outlook Emails activity inside For Each of step 1. Set Filter property to "@SQL=""urn:schemas:httpmail:textdescription"" like '%"+currentOrderNumber+"%'"
  3. Check if any emails filtered returned by step 2.
  4. If filtered mail count > 0 then this is your desired email. Use Forward Email activity to forward the mail to desired recipient.

Sample Solution:

Filter settings:

Thanks,
Ashok :slight_smile:

1 Like

@ashokkarale

Thank you for the prompt reply. I copy your detail guidance into my process but it shows “No email
found”. Can you help take a look if anything incorrect in my process?

image



image
image

@yangyq10,

Everything seems configured correctly. Just try to print value of ‘CurrentDataRow.ToString’

Thanks,
Ashok :slight_smile:

@ashokkarale

I think the resaon is the order number can’t be extracted
I try to print the order number out but it shows “System.Data.DatarRow”

May I know how to make it happen?

image

image

@yangyq10,

To get value from DataRow you can use

currentSO.Item(0)(0).ToString

Thanks,
Ashok :slight_smile:

@ashokkarale Thank you for the patience. I get the order number now but I can’t send out email

Is it relative to the change I did in last one hour?

image


image

@yangyq10,

Just went through the documentation and found out that we cannot solely use Forward Mail activity. This should be within For Each Email activity.

Try this way.

Thanks,
Ashok :slight_smile:

@ashokkarale

I am sorry that it still fail at forward email activity with same error message

@ashokkarale

I look for some info from Internet that we miss a acitivity [getEmailbyID]

Once I add it before forward email, the process can run successfully

1 Like

@yangyq10,

Glad I’m able to help you. Kindly mark my answer as solution as it will help other community member to find it quickly.

Thanks,
Ashok :slight_smile:

@ashokkarale

Thank you for staying with me this afternoon

I already mark your answer as solution

Have a good day~

1 Like

@yangyq10 ,

You are welcome :slight_smile:

Thanks,
Ashok :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.