What does the Value Mapping Functoid do?

Functoids in Biztalk can be very useful. There are many functoids available in Biztalk by default.
Use the Value Mapping functoid to allow a Boolean value to control whether another value gets mapped.

The Value Mapping functoid requires two input parameters, and returns the value of the second input parameter if the value of the first parameter is "true".

When to use the Value Mapping Functoid?

Determine whether to use the Value Mapping functoid or the Value Mapping (Flattening) functoid based on the following characteristics of the relevant portions of the source and destination schemas:

  • Value Mapping. When both the source and the destination schemas define parallel repeating structures between which the relevant data is mapped.

  • Value Mapping (Flattening). When the source schema defines a repeating structure and the destination schema defines a flat structure, such that different instances of the repeating structure in the source schema are intended to be mapped into unique elements in the flat structure in the destination schema.

The Value Mapping functoid returns the value of its second parameter if its first parameter is true. A common use of the functoid is to change the attributes of a field into the attributes of a record

The following code shows an input instance message in which pairs of names and values are assigned to Name and Value attributes.

<ns0:Root xmlns:ns0="http://ValueMapping.WeatherIn">

    <Record>

        <Field Name="WindSpeed" Value="5"/>

        <Field Name="Temperature" Value="20" />

    </Record>

    <Record>

        <Field Name="WindSpeed" Value="15" />

        <Field Name="Temperature" Value="18" />

    </Record>

</ns0:Root>

 

References:

1.       Value Mapping Functoid

2.       Value Mapping Functoid Example

3.       Using the Value Mapping Functoid