BizTalk Mapping Clarification RRS feed

  • General discussion

  • I am having a Source and Destination Schema and using direct map i will get the output.

    My scenario is if the field is not present in the source schema but i need to populate the fields in the output.

    For Example: I am having Date,Name,Country, State in the Source schema. In Detination schema having FullName,Country,State,Date

    I am using directmapping. Name to Name,County to Country, State to State. If the Name is not present in the Source, in the output i need the empty filed.( like <Name/>). But in direct mapping is it possible to achieve this scenario.

    I have checked the XSLT, in that there is a if condition, it will check for the filed if the field is not present in the source schema it wont populate the output with the empty filed. So please tell me is there any possibility to achive in schema itself.

    Note: I will achieve the same scenarion using XSLT. I want to achieve this in Schema.

    Aboorva Raja R

    Wednesday, August 29, 2012 9:33 AM

All replies

  • As of my knowledge we can achive it by Two ways,

    1. Use a script component for a dotnet component input as source schema element which one u want to check. the dotnet component will check the value corresponding output will be element value or emtty string

    2.i.promote the destination schema. ii.In the expression shape check the element/value is present by using xpath, if u did not find the values then u can assign empty string to the element  (after mapping completed).

    Thanks, Vasantha Prabakaran

    Wednesday, August 29, 2012 10:01 AM
  • Hey Raja,

    You can do this by using 1 Logical Existance, 2 Value Mapping, 1 Logical Not and 1 String Concat Functoid.


    Connect Src/Name > Logical Existance Functoid > ValueMapping 1 > Dest/Name
    Connect Src/Name > ValueMapping 2 (As Second Input Parameter)
    Connect Logical Existance Functoid > Logical NOT Functoid > Value Mapping Functoid 2 >Dest/Name
    Add a Constant "" in the String Concat Functoid > ValueMapping Functoid 2 (As Second Input Parameter)

    Explanation : We check if the field exists , then we pass the actual value to the Output field.
    If field not exists , we pass "". We use logical not functoid to negate the output of Logical existance.

    Repeat the same for all the fields. I assume all the mentioned fields are string. 

    Sriram N

    Please mark this as answer if it helps.

    Sriram N

    Wednesday, August 29, 2012 10:37 AM
  • Sriram thanks for your reply, it will be helpful incase of 2 or 3 node.

    Actually i need to check these condition for 130 fileds. So if i use this concept it will become  complicate Map. So i will go with the XSLT implementation instead of using functoid.

    By default the mapping in biztalk will assumes some condition like,

    if we do direct/one to one mapping it is assuming to check the if conditon.


    <xsl:if test="S3:Name><FullName><xsl:value-of select="Name"></FullName>                                                                                                                                                                                       

    So if we can remove the if condition in xslt then we will get the node in the output, if node is not present in the source. if node present we will get the correct value in the output.


    Aboorva Raja R

    Please Mark this as answer if it helps.

    Wednesday, August 29, 2012 11:43 AM