Friday, February 3, 2012

In BizTalk map, use funtoid to skip the output element for some values.

We are using BizTalk 2010 in our project,   In the source schema from our origination system, they use string type to represent datetime, and when the source system can't provide it, for example, when the source system is experiencing some technical difficulties,it use dash instead, thus we need to handle this special character. 

In the destination schema of map , we already set the field to be nullable, so what we need to implement in the map is, when the datetime is not dash, we convert the datetime, and set to the destination element, when it is dash, we need to keep skip it , and leave the destination element untouched.
Here is how I make it happen.

  1. Use a Logical functoid, to make sure the value is not dash.

2.Use a value map functoid.

3.Then send the value to the script functoid to convert the value , and finally map it to the destination element. 
In this way, if the source value is dash, then the destination element will not be assigned any values.