Creating an empty array
Some common scenarios when you may want to create an empty array are when you want to:
Collect several pieces of data in an array over time for later processing, for example, you may wish to collect the outcome of several human tasks
Store the output of an XPath function that returns a node set
While you can create an empty array, you cannot actually use it for anything meaningful until you put some elements into it.
You can create an empty array by using the Copy action and XML Literal in the Data Association editor. This is shown in the following screenshot, which uses a Copy operation with XML Literal to create an empty array. It then immediately uses an Append operation to store the output of an XPath function into that array.
Creating an empty array before storing data in it using the Append operation ensures that there will not be a superfluous initial element in the array with no associated value.
Let's practice creating an empty array now. We will use the scenario...