Re: How to set a default value to an destination schema element in BizTalk Map

Home Page Forums BizTalk 2004 – BizTalk 2010 How to set a default value to an destination schema element in BizTalk Map Re: How to set a default value to an destination schema element in BizTalk Map

#22415

Hi, you can try this:

In this case, the clientCode from source schema is feed into an IsNil logical functoid, a “Logical Existence” logical functoid and a scripting functoid (S1). S1 is an Inline C# script type with this code:

public System.Boolean MyConcat(string param1)
{
 return System.String.IsNullOrEmpty(param1);
}

Then the result of IsNil function, “Logical Existence” and S1 functoids are feeded into a logical OR functoid. Then the result of the logica OR functoid is feeded into a logical NOT function, which in turn feeds into a ValueMapping functoid (VM1) as first input. And the ClientCode of the source schema is also feeded into the the same value mapping functoid (VM1) as the second input. The result of of VM1 is then feeded to the ClientCode in the destination schema.

The result of the logical OR functoid also feeds into ValueMapping functoid (VM2) as the first input, the 2nd input parameter is configured to “N/A”. then the result of VM2 is feeded to the ClientCode in the destination schema.

This way, DestinationSchema.ClientCode=SourceSchema.Client if SourceSchema.Client exist, not null, and not empty, otherwise, DestinationSchema.ClientCode=”N/A”.

Hope this helps.