---
title: "Set long text field size"
description: "Calculate the long text size of selected documents and save it to a decimal field with the Set long text field size operation, for SQL or Data Grid text."
feature: "Mass Operations"
audience: ["end user", "developer", "system analyst", "system administrator", "system engineer"]
version: "Relativity aiR"
type: ["User Guide", "Tutorial"]
url: "https://help.relativity.com/RelativityaiR/Content/Relativity/Mass_operations/Set_long_text_field_size.htm"
lastModified: "2026-11-23"
---

# Set long text field size

You can use the set long text field size operation to calculate long text size and save the value in a decimal field for each selected document. The mass operation is available from the mass operations bar. You can use the mass operation with Data Grid-enabled or SQL extracted text fields. This feature is useful when creating views and saved searches of documents based on long text size. In Relativity, long text is declared as an uncompressed nvarchar(max). This means it will always hold each character as 2 bytes in terms of how this operation calculates the size of the long text field.

> **Note:** The Set Long Text Field Size operation measures the size of the selected field using UTF-16 encoding. The sizes it estimates may be double the UTF-8 value used by some features, such as structured analytics.

## Before you begin

To enable the mass operation in your Relativity instance, you must import the Long Text Size application from the application library. To do this, you must have the appropriate admin rights.

To install the Set Long Text Field Size application in your workspace:

1. Navigate to the **Relativity Applications** tab.
2. Click **New Relativity Application**.
3. Select **Select from Application Library**.
4. Click ![ellipsis button](https://help.relativity.com/RelativityaiR/Content/Resources/Images/Icons/ICN_Ellipsis.png) on **Choose from Application Library**.
5. Select **Set LongText Field Size**, and click **OK**.
6. Click **Import**.

> **Note:** After the application is installed, review the workspace permissions and remove the Set Long Text Field Size permission for the groups that should not have access to the mass operation.

### Set long text field size considerations

- There’s no hard limit on the number of documents you can update with the Set Long Text Fields Size script.
- Because this is a mass operation, run it during a maintenance window or other low-usage hours to minimize performance impact.
- Run time varies by document size and total volume. Larger documents take longer, and benchmark metrics aren’t available to predict duration for very large sets (for example, 1,000,000 documents). To plan, run a small test batch, review results, and then scale up.

## Using the mass operation

To set long text size:

1. Create a decimal field for saving the extracted text size. For more information, see [Fields](https://help.relativity.com/RelativityaiR/Content/Relativity/Fields/Fields.md).
2. From the mass operations bar on the document list, choose whether to select **Checked items** or **All items** in the current returned set.

   > **Note:** The set long text size mass operation permits the user to edit documents even if they have read-only permissions.
3. Select **Set long text field size** in the mass operations drop-down menu.  
   The Set LongText Size form displays.
4. Select a source field to calculate long text size. The drop-down menu includes all long text fields you have permissions to see.
5. Select a decimal field to store the calculated long text size. The drop-down menu includes all decimal fields you have permissions to see.
6. Click **Run** to apply your changes.

> **Note:** The mass operation stores the size of the text, in kilobytes, in the decimal field.
