Skip to content

Auto Size Action: autoSize

The autoSize action is used to automatically adjust the width of columns in an Excel sheet to fit the content. This ensures improved readability and a professional appearance of the data.

Note: Ensure that the file being used is not open during the Case execution to avoid errors or conflicts.

Example: You have an Excel file, employeeData.xlsx, with a sheet named HR Records. The column data is not fully visible due to mismatched widths, and you want to apply the autoSize action to correct this.

Steps to Configure:

  1. Select Set a Variable Value from the Action dropdown.
  2. Enter a variable name in Element Key (e.g., ResizedExcelFile). This variable will store the updated file path after the operation.
  3. Click on Form, select Functions, and choose EXCEL Handler Functions.
  4. In the Cmd field, select autoSize and provide the following parameters:
    • FPath: Specify the path of the Excel file (e.g., C:\CompanyData\employeeData.xlsx).
  5. Click Save.
Tabular View
Card View

Outcome on execution:

  • The action automatically adjusts the widths of all columns in the sheet HR Records.
  • If the operation is successful, it returns true, which is stored in the variable defined in the Element Key field (e.g., ResizedExcelFile).
  • If the operation fails (e.g., file not found or insufficient permissions), it returns false.
  • This variable can be referenced in subsequent steps of the automation process using the syntax ${VariableName} (e.g., ${ResizedExcelFile}).

Back To Top