Coercion Failed: If any email address column is null
-
יום רביעי 08 אוגוסט 2012 21:54
I have created a custom workflow in SharePoint Designer 2010.
There are 3 columns that are NOT required:
Column 1 = Subject Matter Experts
Column 2 = Other Stakeholders
Column 3 = Impacted Parties
These fields are for the end user to enter the email address of an employee in our outlook directory.
They can type in the email address and click the "check" icon or they can click on the "book" icon, type in the name of the user and then click enter.
From there, they can select the user from the list displayed in the "Select People Webpage Dialog" and click OK.
My workflow has been designed like this:
Step 1
If CurrentItem:Subject Matter Experts is not empty
Email CurrentItem:Subject Matter Experts
then Log Email sent to SME to the workflow history list
Else if Current Item:Subject Matter Experts is empty
Log No SME assigned to the workflow history list.
Step 2
If CurrentItem:Other Stakeholders is not empty
Email CurrentItem:Other Stakeholders
then Log Email sent to Other Stakeholders to the workflow history list
Else if Current Item:Other Stakeholders is empty
Log No Other Stakeholders assigned to the workflow history list.
Step 3
If CurrentItem:Impacted Parties is not empty
Email CurrentItem:Impacted Parties
then Log Email sent to Impacted Parties to the workflow history list
Else if Current Item:Impacted Parties is empty
Log No Impacted Parties assigned to the workflow history list.
The workflow is 'Canceled' and I get the following error message if either of the three columns referenced above is null:
Event Type: Error
User ID: System Account
Description: Coercion Failed: Input cannot be null for this coercion.
I do not get the error message above if all three columns are populated.
כל התגובות
-
יום חמישי 09 אוגוסט 2012 10:32מנחה דיון
Hi ,
I understand that you have three columns to hold the email address. When one of the columns are empty ,there is an Coercion Failed error. When adding the ‘Send an email ’ action, how do you set the user in ‘To’?
When using the workflow lookup for a user ,you should choose to return the field as String.
For more information ,please refer to this site:
Getting this error "Coercion Failed: Input cannot be null for this coercion." on all workflows created with SharePoint Designer 2010 but one.: http://social.technet.microsoft.com/Forums/en-US/sharepoint2010customization/thread/831997ea-bcbb-4c76-8039-7d78f26badee/
Thanks,
Entan Ming
Entan Ming
TechNet Community Support
-
יום חמישי 09 אוגוסט 2012 15:15
Hello Entan,
I modified the email message's "To" field as follows:
Return field as: As String
This did not work. I still received the same error message.
-
יום שישי 10 אוגוסט 2012 13:31
I have found that by setting up my workflow logic as below, I do not encounter as many strange errors.
This does not seem to cause any Coercion errors.
Step 1 - Figure out who is being emailed If CurrentItem:Subject Matter Experts is empty If CurrentItem:Other Stakeholders is empty If CurrentItem:Impacted Parties is empty then Stop the workflow and log "No groups assigned to the workflow history list." Else if CurrentItem:Subject Matter Experts is not empty Set Variable:SME to Yes If CurrentItem:Other Stakeholders is not empty Set Variable:OS to Yes If CurrentItem:Impacted Parties is not empty Set Variable:IP to Yes Step 2 - Send emails If Variable:SME equals Yes Email CurrentItem:Subject Matter Experts then Log... If Variable:OS equals Yes Email CurrentItem:Other Stakeholders then Log... If Variable:IP equals Yes Email CurrentItem:Impacted Parties then Log.. Step 3 - Addit. Logging If Variable:SME equals Yes If Variable:OS equals Yes If Variable:IP equals Yes Stop the workflow and log "Done. Emails sent." If Variable:SME equals No then Log... If Variable:OS equals No then Log... If Variable:IP equals No then Log...
then Stop the workflow and log "Workflow complete."
- נערך על-ידי antshsh יום שישי 10 אוגוסט 2012 13:33 fixed mistake and added tabs
- נערך על-ידי antshsh יום שישי 10 אוגוסט 2012 13:34 add steps to code box to make it readable
- נערך על-ידי antshsh יום שישי 10 אוגוסט 2012 13:36 am having a lot of trouble with formatting today
- סומן כתשובה על-ידי Entan MingMicrosoft Contingent Staff, Moderator יום חמישי 16 אוגוסט 2012 02:46
-
יום שישי 10 אוגוסט 2012 15:48
Mrs. Jackson
as a test, email yourself the contents of your email field.
workflow action: send email. To: domain\you. Body of email: add your fields.
let me know what you see.
-
יום שישי 10 אוגוסט 2012 17:19Also, you can add logging before the emails are sent out, to try and follow on which "line" it is failing.