Set Content of Cell

This action formats the content of a cell and inserts the content into a spreadsheet cell.

Properties

Configure the Set Content of Cell action using Content and Format properties.

Content

From the Content box list, use the following options to set the content of a cell:

  • Value:- Select Value from the list and type a value.
  • Variable: Select Variable from the list and select a variable to store the value.
  • Expression: Select Expression and create an expression to set the value.
  • Converters: Select Converters and create a data converter to set the value.

Format

From the Format box list, use the following options to format a cell:

  • Value:- Select Value, then either select a predefined value from the list or type a value.
  • Variable: Select Variable, then select a variable to store the value.
  • Expression: Select Expression and create an expression to specify the value.
  • Converters: Select Converters and create a data converter to set the value.

Rules and results

A cell acquires the data type of the content inserted. How formats and data types are processed varies, based on:

  • What the format of the cell is before you set the Content properties.

  • Whether the user specified a format.

  • What the data to be set looks like.

Be aware that inconsistencies might occur between the format and cell data type.

For example, if a Boolean cell is formatted as a number, the number format is ignored and the cell data is processed and shown as a Boolean result. However, if the cell content is changed to a number, then it is shown as a number.

The cell acquires the type of content inserted, which means it acquires the type Number when the content is a number, or the type Boolean when a Boolean value is entered.

Rules

When setting the content of a cell, the following rules apply.

  1. If you specify the format in the step, then the format carries over and applies to the cell.

  2. If rule 1 does not apply, but you have a format set on the cell that is consistent with the data type, then the cell format applies.

  3. If neither of the two previous rules apply, then the format is General, and the resulting format depends on the data type. (General format is the default format that Excel applies.)

    In the spreadsheet, results are formatted as follows:

    • Numbers are right-aligned.

    • Boolean content is centered.

    • Text is left-aligned.

Results

Use the Test Cell Type step action to test the results of your Set Content of Cell action.

Each cell type is processed based on the data type, and the result is formatted as follows:

  • If data comes from a variable or an expression and:

    • Format is General, the cell type is determined from type of the variable or expression.

    • Format is not General, the cell type is determined by matching the format consistent with the data.

      Examples:

      If the format is "@" (text), the cell type becomes Text.

      If the format is a number and the data is a date in number format, the cell type becomes Number.

  • If data comes from a value or a Converter stack and:

    • Format is General, the cell type is determined from the data.

    • Format is not General, the cell type is determined from the format.

Note the following special cases:

  • If the data type is Date, the data is converted to a number representing the date as Excel data. The cell is only shown as a date if the format is set to a date number format.

  • Entering a number followed by a D letter in an Excel cell causes the D letter to disappear. To avoid this issue, add a single quotation mark in front of the number, such as: '12358D.