Skip to main content
Skip table of contents

insertRowValues

This command requires an extra license.

A child command for modifyWorkbook will, through its child commands, set values into one or multiple cells of the specified row. Any cell content on the specified row or below it (ie. has a higher row index) on or between the columns that are being modified gets shifted one row downwards, so insertRowValues will never overwrite any existing cell content.

Parent commands

  • modifyWorkbook
    Required. This parent defines the workbook that is modified.

Child commands

  • rowCell
    Required. At least one of these child commands is required to set a new value for a cell in the specified row.

Attributes

row

Required

Value type

EL-evaluated

Yes

Number

Yes

Defines the row whose cells will be modified by the child commands. The resolved value is expected to be a row index Number, with the first row having an index of 1. 

sheet

Required

Value type

EL-evaluated

Yes

String

Yes

Defines the sheet where the target row is in. The resolved String is expected to be the name of a sheet in the workbook.

Examples

As insertRowValues provides a simple way to set values into multiple cells of a row, it pairs well with forEach for producing multiple content-filled rows. One could, for example, make rows out of Salesforce query results - the following goes through a Collection of Opportunity records, setting the Name and Amount of each Opportunity onto its row. The (OLD / LEGACY)Loop status provided by forEach is used to generate the sequential row indexes, with the first row to modify in this example being row 4.

CODE
<forEach value="${opportunities}" var="opp" varStatus="status"><insertRowValues row="${status.count + 3}" sheet="Sheet1"><rowCell column="A" value="${opp.Name}"/><rowCell column="C" value="${opp.Amount}"/>

Any existing cell content on the sheet that is on row 4 or below on columns A, B, or C is shifted down as many rows as there are Opportunities to loop through. Any content on those rows on any other column would remain in place.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.