Share via


Conditional Assignment Example: BizTalk Services

 

Important

Microsoft Azure BizTalk Services (MABS) is being retired, and replaced with Azure Logic Apps. If you currently use MABS, then Move from BizTalk Services to Logic Appsprovides some guidance on moving your integration solutions to Logic Apps.

If you're brand new to Logic Apps, then we suggest getting started here:

Lists a Conditional Assignment example in Microsoft Azure BizTalk Services.

Conditional Assignment Example

The input document has a Person node with a Title field. The output document also has a Title field. The goal is for the Title field in the output document be created only if Title exists in the input document and if the Title field is not null.

To do this, use the Conditional Assignment Map Operation:

  1. Drag the Conditional Assignment Map Operation to the Transform Designer area.

  2. Create a link from the Title field in the output document to this Conditional Assignment Map Operation.

  3. Add a Logical Expression Map Operation and do the following:

    • Create a link from the Title field in the input document to this Logical Expression Map Operation.

    • Configure the Logical Expression Map Operation to state: Exists(Title) && !IsEmpty(Title)

    • Create a link from the output of this Logical Expression as the first input to the Conditional Assignment Map Operation.

  4. Create a link from the Title field in the input document to the Conditional Assignment Map Operation.

With this Transform, the Title node in the output is created only if the Title node in the input document exists and is non-empty.

See Also

Arithmetic Expression Examples: BizTalk Services
Logical Expression Examples: BizTalk Services
If-Then-Else Expression Example: BizTalk Services
Expressions in BizTalk Services - Usage and Examples