Append To Grid
    • Dark
      Light

    Append To Grid

    • Dark
      Light

    Article Summary

    Append To Grid

    The Append To Grid component lets users append or prepend data to a pre-existing grid variable in Matillion ETL. Running this component can add rows to existing columns, but does not add columns to the grid.

    Properties

    PropertySettingDescription
    NameStringA human-readable name for the component.
    Append/PrependSelectChoose whether to append or prepend your data rows to the grid.
    Target Grid VariableSelectInput the name of the grid variable that is to be appended or prepended.
    Fixed/GridSelectChoose between "Fixed" data, which users must input manually, and "Grid" data, which uses an existing grid variable. In both cases, the data is to be appended or prepended to the target grid.
    Values GridMultiple SelectFor fixed data, the user should manually enter data for new rows in the target grid.
    Note: This property is only available when the Fixed/Grid property is set to Fixed.
    Source Grid VariableSelectChoose the name of the grid from which to source data.
    Note: This property is only available when the Fixed/Grid property is set to Grid.
    Column MappingMultiple SelectMap columns from the source grid to the target grid.
    Note: This property is only available when the Fixed/Grid property is set to Grid.

    Example

    In this example, we have a table that holds flight data from the previous year. The aim of this job is to create a table with identical metadata for the upcoming year, but to also include a new field for refunds given for particular flights. This additional row is called "refundtotal".

    This job requires using the Table Metadata to Grid component to copy the original table's metadata, and then the Append To Grid component to append an additional row ("refundtotal") to the metadata grid, before finally creating the new table via the Create Table component. The Orchestration Job, with all four components, is shown in the image below.

    Append To Grid example Orchestration Job

    Next, we need to create a grid variable. We can do this by right-clicking the Table Metadata to Grid component, and left-clicking the Manage Grid Variables option in the menu. See the below image.

    Right-click a component to access Manage Grid Variables

    In the "Manage Grid Variables" window, click the button to create a new grid variable.

    The metadata for the flights table is shown below. We create a grid variable for the job with fields relating to our expected table metadata, such as "name", "type", "size", "encoding", and "precision".

    Create Grid Variable window

    The Table Metadata to Grid component is configured as shown below.

    We then load this grid with metadata using the Get Metadata component before being appended using the Append To Grid component. The new data will be of 'Fixed' format.