Skip to content
+1-888-319-3663

COMMUNITY FORUM

Map failing going to Salesforce because of date

Brandon asked 2 years ago
Hello, 
I have a map I have setup that is coming from a SQL database, going to the salesforce Account entity.  I have multiple columns with the my salesforce that are date/time.  I also have multiple columns in my database that are date time.  
I setup my mapping just fine, map the ‘date1’ column in my sql database to the ‘date1’ column in salesforce.  However, my SQL database column record ‘date1’ is NULL.  I understand that smartconnect will turn that NULL value into a blank, but the integration still gives me the error ”is not a valid value for the type xsd:datetime.  
I know that salesforce can have a blank for that column, because I have manually created entries without a date.  My question is, does anyone know how I can force a blank value into the date field in salesforce, or just get smartconnect to completely ignore it (since it is blank, it doesn’t try to integrate it, right)?  It doesn’t show my XML output as one of the columns being sent. 
I am very confused.  Any help would be appreciated.
Thanks, 
Brandon
Answers
Ethan Sorenson Staff answered 2 years ago
Brandon,
 
SmartConnect will not automatically convert the null to a blank. You can do this manually using a calculated column.
https://www.eonesolutions.com/Manuals/SmartConnect/SmartConnect%202018/?page=sc_calculated_column
 
If _DATE1 = “NULL” then
return “”
else
return Convert.ToDateTime(_SOURCEFIELD).ToString(“yyyy-MM-ddThh:mm:ss”) 
End IF

If you would like to submit an answer or comment, please sign in to the eOne portal.