If-Then-Else Expression Example: BizTalk Services
Updated: November 27, 2015
Lists If-Then-Else example in Microsoft Azure BizTalk Services.
There is a Zip field in the input document and a State field in the output document. If the Zip is 98052 in the input document, then the State field in the output document is updated with WA. If the Zip is not 98052, State is updated with Other.
To do this, add an If-Then-Else Expression Map Operation to the Transform:
Drag the If-Then-Else Expression to the Transform Designer area.
Create a link from the Zip field in the input document to this If-Then-Else Expression.
Create a link from the State field in the output document to this If-Then-Else Expression.
Configure the If-Then-Else Expression with the following parameters:
The input name will be displayed as the node name it is connected to in the input document.
Zip == 98052
With this Transform, the State node in the output is populated with WA if the zip code is 98052. If the zip code is not 98052, the State node is populated with Other.
If an error occurs with an If-Then-Else Expression Map Operation, by default, the entire Transform is aborted. This error handling behavior is configurable. See Error and Data Handling at Expressions in BizTalk Services - Usage and Examples.