none
Workflow to send only one email with information based on rules

    Question

  • Hi all,

    I'm trying to create a workflow that send only one email even send an email to each condition

    Example:

    if current item:line1 is not empty

    if current item:line2 is not empty

    if current item:line3 is not empty

    send one only email with result from

    line1

    line2

    line3

    thank you


    Certified (35) | ITIL | MCP | MCDST | MCSA1 | MCSE1 | MCT | MCTS Sharepoint | MCITP SQL | MCSA Windows 2012 | MTA Security | MCSE Windows 8 | MCSE Windows 2012 | Vencedor do Winthe7.com.br 2009, Quarto lugar Copa de Talentos Microsoft 2010

    Tuesday, May 28, 2013 2:10 PM

Answers

  • Your Coercion error is because you have null fields and you are trying to pull information. SharePoint does not know how to address null fields when dealing with lookups. Your workaround is to fill these with a space if you are trying to pull all three fields and they are null at times. Your other workaround is to lookup for the fields that are not empty as you are explaining to me is what you are trying to do. To accomplish this you need to do the following in your workflow:

    If Field 1 is not empty
    AND if Field 2 is not empty
    AND if field 3 is not empty
    Email Field 1, 2, 3
    Stop Workflow Log Emailed 1, 2, 3

    Else If Field 1 is not empty
    AND if field 2 is not empty
    Email Field 1, 2
    Stop Workflow Log Emailed 1, 2

    Else If Field 1 Is not empty
    and if Field 3 is not empty
    Email Field 1, 3
    Stop Workflow Log Emailed 1, 3

    Else If Field 2 is not empty
    and If Field 3 is not Empty
    Email Field 2, 3
    Stop Workflow Log Emailed 2, 3

    You need to check to see that each value is not empty, and to do this you need to use IF, then and IF

    • Marked as answer by Adriano Neiva Tuesday, May 28, 2013 3:44 PM
    Tuesday, May 28, 2013 3:38 PM

All replies

  • I'm not sure that I completely understand, but let me take a wack at it...

    This will send an e-mail based on if Field 1, 2, or 3, are empty. It will progress through and find the first field that is not empty. If I have misunderstood I apologize.

    Reading this a second way,
    I would send 1 e-mail, in the e-mail add Line 1, Line 2, and Line 3 in the e-mail, this way whether or not the field is empty it will be displayed. I do not believe however, it is possible to give say just Line 1 and Line 3 without a really complex If Statement.

    Example:

    If Line 1 is not empty

    AND if Line 2 is not Empty

    AND if line 3 is not Empty

    Email Line 1 Line 2 Line 3

    Else If Line 1 is not empty

    AND if Line 2 is not Empty

    Email Line 1 Line 2

    Else If Line 1 is not empty

    AND if Line 3 is not Empty

    Email Line 1 Line 3

    And so on until you have covered every possible variation of the 3 lines.

    Tuesday, May 28, 2013 2:29 PM
  • sorry, let me try explain again.

    I'm creating a simple form that look for information in some sharepoint list and after that must be send an e-mail with information found on those list.

    the S-FS-SV07 is from a sharepoint list. sometimes I will fill the three fields, but some time I will fill only one field. I would like to send a single email containing the information filled in these fields> I'm having some issues with my workfllow, when a fill the first two fields only, I'm getting the error Coercion Failed: lookup value (as text), because that I'm asking about condition to send email with field not empty. sorry for my English.. ,


    Certified (35) | ITIL | MCP | MCDST | MCSA1 | MCSE1 | MCT | MCTS Sharepoint | MCITP SQL | MCSA Windows 2012 | MTA Security | MCSE Windows 8 | MCSE Windows 2012 | Vencedor do Winthe7.com.br 2009, Quarto lugar Copa de Talentos Microsoft 2010

    Tuesday, May 28, 2013 2:43 PM
  • Your Coercion error is because you have null fields and you are trying to pull information. SharePoint does not know how to address null fields when dealing with lookups. Your workaround is to fill these with a space if you are trying to pull all three fields and they are null at times. Your other workaround is to lookup for the fields that are not empty as you are explaining to me is what you are trying to do. To accomplish this you need to do the following in your workflow:

    If Field 1 is not empty
    AND if Field 2 is not empty
    AND if field 3 is not empty
    Email Field 1, 2, 3
    Stop Workflow Log Emailed 1, 2, 3

    Else If Field 1 is not empty
    AND if field 2 is not empty
    Email Field 1, 2
    Stop Workflow Log Emailed 1, 2

    Else If Field 1 Is not empty
    and if Field 3 is not empty
    Email Field 1, 3
    Stop Workflow Log Emailed 1, 3

    Else If Field 2 is not empty
    and If Field 3 is not Empty
    Email Field 2, 3
    Stop Workflow Log Emailed 2, 3

    You need to check to see that each value is not empty, and to do this you need to use IF, then and IF

    • Marked as answer by Adriano Neiva Tuesday, May 28, 2013 3:44 PM
    Tuesday, May 28, 2013 3:38 PM
  • thank you Zach Little

    Certified (35) | ITIL | MCP | MCDST | MCSA1 | MCSE1 | MCT | MCTS Sharepoint | MCITP SQL | MCSA Windows 2012 | MTA Security | MCSE Windows 8 | MCSE Windows 2012 | Vencedor do Winthe7.com.br 2009, Quarto lugar Copa de Talentos Microsoft 2010

    Tuesday, May 28, 2013 3:44 PM