Share via


Date / Time Map Operations - Usage and Examples

 

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 the Date/Time Map Operations in Microsoft Azure BizTalk Services.

Date/Time Map Operations

Map Operation

Description

Parameters

Output

DateTime Reformat

Reformats a date/time value.

Requires exactly one input parameter:

Input

A link from a tree node.

In Input Format, specify the appropriate format. In Output Format, specify the desired output format.

The incoming date/time value will be formatted to the new output format.

Generate Date Time

Generates the current Date/Time.

In Output Format, specify the desired format.

The incoming value is generated using the Date/Time format specified.

Adjust TimeZone

Converts a date/time value to a different time zone. An Input Date is parsed and then converted from the Input time zone to the Output time zone.

Some key points:

  • When only a date is specified for Input Date, 12AM is used for the time.

  • When the Input Date value contains the "K" format, the Input TimeZone option is grayed out. At runtime, the Input Time Zone is extracted from the Input Date value. If Input Date is not present, UTC is used.

Requires exactly one input parameter:

Input Date

A link from a tree node or an entered date value.

Also specify the following:

  • Input Format: Select a Date/Time format of the Input Date specified.

  • Input TimeZone:

  • Output TimeZone:

The incoming Date value is converted to the Output time zone.

Known Issue

When a DateTime Reformat Map Operation is added to the design area and configured, the Format drop-down list may be grayed out. This can happen if the computer Display is set Medium – 125% or Larger – 150%.

To resolve, set the display to Smaller – 100% (default) using the following steps:

  1. Open the Control Panel and select Appearance and Personalization.

  2. Select Display.

  3. Select Smaller – 100% (default) and select Apply.

The Format drop-down list should now work as expected.

Error and Data Handling

BizTalk Services provides the ability to configure how an error is handled and how an empty or null node is handled. The error handling behavior of Date / Time is configurable in a BizTalk Service project and the BizTalk Service Artifacts project. Steps:

  1. Open a BizTalk Service project or a BizTalk Service Artifacts project in Visual Studio.

  2. Double-click a Transform (.trfm) to open the Transform Designer.

  3. In the Transform toolbar, select Settings.

Error Handling tab

In the Error Handling tab, Date / Time Operations have two Behavior options:

  • Fail map: The entire Transform is aborted. Since Transforms are executed within a pipeline, an error occurs within the pipeline and is then sent to the user who sent the message.

  • Output default value Null: A null value is returned as the output. A null value behaves as an empty value behaves except when sorting a List. When sorting a List, null values are considered less than empty values.

Null/Empty Data Handling tab

In the Null/Empty Data Handling tab, there are three options:

  • Consider empty nodes in cumulative operations: By default, this is not checked. When not checked, no empty nodes are included in the iteration. When checked, all nodes, including empty nodes, are included in the iteration.

    EXAMPLE: There is a document with 10 <record> nodes. Three of these <record> nodes are empty. When Consider empty nodes in iterations is not checked, the Map Operation returns a value of seven. When Consider empty nodes in iterations is checked, the Map Operation returns a value of 10.

  • Consider empty nodes in iterations: By default, this is not checked. When not checked, no empty nodes are included in the iteration. When checked, all nodes, including empty nodes, are included in the iteration.

    EXAMPLE: there is a document with 10 <record> nodes. Three of these <record> nodes are empty. When Consider empty nodes in iterations is not checked, the Map Operation iterates seven times for the non-empty nodes. As a result, seven <record> nodes are generated in the Target. When Consider empty nodes in iterations is checked, the Map Operation iterates 10 times for all nodes, including the empty nodes. As a result, 10 <record> nodes are generated in the Target.

  • Target Node Generation: If empty nodes are configured to be considered, you choose to generate an empty node in the output or to not generate an empty node in the output. Specifically:

    • Do not generate empty nodes: Default option.

    • Generate empty nodes

    EXAMPLE: There is a document with 10 <record> nodes. Three of these <record> nodes are empty. Consider empty nodes in cumulative operations or Consider empty nodes in iterations are not checked, the Map Operation iterates seven times for the non-empty nodes. As a result, seven <record> nodes are generated in the Target. When Consider empty nodes in iterations is checked, the Map Operation iterates 10 times for all nodes, including the empty nodes. As a result, 10 <record> nodes are generated in the Target.

Additional Map Operations

String Map Operations - Usage and Examples

Loop Map Operations - Usage and Examples

Expressions in BizTalk Services - Usage and Examples

List Map Operations - Usage and Examples

Cumulative Map Operations - Usage and Examples

Miscellaneous Map Operations - Usage and Examples

See Also

Create a Transform or Map