---
schema_version: "1"
id: c814f2daf048f4446e9e5521528c7c6e0675d9546d5ac5cefae0713f6b93a854
title: Override an Edit Block LWC in Omniscripts
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_override_an_edit_block_lwc_14965.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_override_an_edit_block_lwc_14965.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: c26a793d827e5162e64252e3c1e4ceefa34e340c4d266685a7d3b1b4a1ddd31b
description: Apply custom code to an Edit Block by extending and overriding the Edit Block's lightning web components. Edit Blocks contain up to three LWC override fields based on the Edit Block's Edit mode.
products:
  - Omnistudio
release: "264"
---
# Override an Edit Block LWC in Omniscripts

Apply custom code to an Edit Block by extending and overriding the Edit Block's lightning web components. Edit Blocks contain up to three LWC override fields based on the Edit Block's Edit mode.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col>
          <col>
          <col>
          <col>
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d48503e40">
              <p style="margin-bottom:0;">Property</p>
            </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d48503e46">
              <p style="margin-bottom:0;">Description</p>
            </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d48503e52">
              <p style="margin-bottom:0;">Compatible Edit Modes</p>
            </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d48503e58">
              <p style="margin-bottom:0;">Example</p>
            </th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d48503e40 ">
              <p style="margin-bottom:0;">
                <strong class="uicontrol">LWC Component Override</strong>
              </p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d48503e46 ">
              <p style="margin-bottom:0;">Customize the Edit Block component by extending the Edit Block component.</p>
            </td>

            <td data-label="Compatible Edit Modes" class="slds-cell-wrap" style="vertical-align:top;" headers="d48503e52 ">
              <p style="margin-bottom:0;">All</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d48503e58 ">
              <p style="margin-bottom:0;">
                <a href="https://help.salesforce.com/s/articleView?id=xcloud.os_override_an_edit_block_lwc_14965.htm&amp;release=264.0.0&amp;type=5" title="Customize an LWC Omniscript's Edit Block by extending the Edit Block LWC.">Extend the Edit Block LWC</a>
              </p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d48503e40 ">
              <p style="margin-bottom:0;">
                <strong class="uicontrol">Edit Block Label LWC Component Override</strong>
              </p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d48503e46 ">
              <p style="margin-bottom:0;">Customize the Edit Block's label by overriding the label component.</p>
            </td>

            <td data-label="Compatible Edit Modes" class="slds-cell-wrap" style="vertical-align:top;" headers="d48503e52 ">
              <p style="margin-bottom:0;">Cards, Long Cards</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d48503e58 ">
              <p style="margin-bottom:0;">
                <a href="https://help.salesforce.com/s/articleView?id=xcloud.os_override_an_edit_block_lwc_14965.htm&amp;release=264.0.0&amp;type=5" title="Customize an LWC Edit Block's Label for the Cards and Long Cards edit modes by extending the Edit Block Label LWC. Exclusive to Cards and Long Cards edit mode, the Edit Block Label LWC overrides the original labels, including global actions.">Extend the Edit Block Label LWC</a>
              </p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d48503e40 ">
              <p style="margin-bottom:0;">
                <strong class="uicontrol">Edit Block New LWC Component Override</strong>
              </p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d48503e46 ">
              <p style="margin-bottom:0;">Customize the Edit Block Card users click to create new entries by overriding the New LWC component.</p>
            </td>

            <td data-label="Compatible Edit Modes" class="slds-cell-wrap" style="vertical-align:top;" headers="d48503e52 ">
              <p style="margin-bottom:0;">Cards</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d48503e58 ">
              <p style="margin-bottom:0;">
                <a href="https://help.salesforce.com/s/articleView?id=xcloud.os_override_an_edit_block_lwc_14965.htm&amp;release=264.0.0&amp;type=5" title="Customize an LWC Edit Block's new entry card by extending the Edit Block New LWC. Exclusive to the Card edit mode, the Edit Block New LWC overrides the new entry card.">Extend the Edit Block New LWC</a>
              </p>
            </td>

          </tr>
        </tbody>
      </table>

## Extend the Edit Block LWC

Customize an LWC Omniscript's Edit Block by extending the Edit Block LWC.

The Edit Block LWC overrides the entire Edit Block LWC unless the Edit Mode is Cards or Long Cards. Cards and Long Cards include additional extendable LWCs. For information on Cards and Long Cards LWC options, see [Override an Edit Block LWC in Omniscripts](https://help.salesforce.com/s/articleView?id=xcloud.os_override_an_edit_block_lwc_14965.htm&release=264.0.0&type=5 "Apply custom code to an Edit Block by extending and overriding the Edit Block's lightning web components. Edit Blocks contain up to three LWC override fields based on the Edit Block's Edit mode.").

1. In VisualStudio, create a custom LWC and change the background of the Edit Block card to green.
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
                <colgroup>
                  <col>
                  <col>
                </colgroup>
                <thead class="slds-text-title_caps ">
                  <tr class="">
                    <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d48503e237">
                      <p style="margin-bottom:0;">Original Edit Block Card</p>
                    </th>
                    <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d48503e243">
                      <p style="margin-bottom:0;">Custom Edit Block Card Example</p>
                    </th>
                  </tr>
                </thead>
                <tbody>
                  <tr class="">
                    <td data-label="Original Edit Block Card" class="slds-cell-wrap" style="vertical-align:top;" headers="d48503e237 ">
                      <div><img src="https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/omnistudio/images/owc_edit_block_card_og.png" alt="An image of the original, unedited Edit Block"></div>
                    </td>

                    <td data-label="Custom Edit Block Card Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d48503e243 ">
                      <div><img src="https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/omnistudio/images/edit_block_card_lwc.png" alt="An image of the custom edit block after the background color was changed to green"></div>
                    </td>

                  </tr>
                </tbody>
              </table>
2. In the LWC's JavaScript file, extend the Edit Block LWC. Using this code example, replace the NS with the namespace of the package. For information on finding the namespace, see [View the Namespace and Version of Managed Packages](https://help.salesforce.com/s/articleView?id=xcloud.os_viewing_the_namespace_and_version_of_the_omnistudio_vlocity_package_8315.htm&release=264.0.0&type=5 "Omnistudio can be installed as a managed package. The package might be for a Cloud product (such as Insurance or Communications) or Omnistudio Foundation. You can check the namespace and version of your managed package, which you might need for planning upgrades or troubleshooting.").
    
    Example:
    
    ```
    import omniscriptEditBlock from "VLOCITYNAMESPACE/omniscriptEditBlock";
        import template from "./editblockCardCustomize.html"
        export default class editblockCardCustomize extends omniscriptEditBlock{
            // your properties and methods here
            
            render()
            {
                if (this.jsonDef) {
                    this._hasChildren = this.jsonDef.children.length > 0;
                    this._isFirstIndex = this.jsonDef.index === 0;
    
                    if (this._isCards && this._isFirstIndex) {
                        // hides the first short card with no children
                        if (!this._hasChildren) {
                            this.classList.add(this._theme + '-hide');
                        } else {
                            this.classList.remove(this._theme + '-hide');
                        }
                    }
                }
                return template;
            }
        }
    ```
3. Add code to the custom LWC.
4. Deploy the custom LWC to Salesforce. See [Deploy Lightning Web Components](https://help.salesforce.com/s/articleView?id=xcloud.os_deploy_lightning_web_components_58289.htm&release=264.0.0&type=5 "Deploy new Lightning web components or change existing components from your local development environment with Visual Studio and Salesforce DX or IDX Workbench.").
5. Go to the Omniscript that contains the Edit Block LWC.
6. In the Edit Block's **LWC Component Override** field, enter the name of the custom LWC.
7. Activate the Omniscript, and preview your changes.

## Extend the Edit Block Label LWC

Customize an LWC Edit Block's Label for the Cards and Long Cards edit modes by extending the Edit Block Label LWC. Exclusive to Cards and Long Cards edit mode, the Edit Block Label LWC overrides the original labels, including global actions.

1. In VisualStudio, create a custom LWC and change the label of a global action to green.
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
                <colgroup>
                  <col>
                  <col>
                </colgroup>
                <thead class="slds-text-title_caps ">
                  <tr class="">
                    <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d48503e384">
                      <p style="margin-bottom:0;">Original Edit Block Label</p>
                    </th>
                    <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d48503e390">
                      <p style="margin-bottom:0;">Custom Edit Block Label</p>
                    </th>
                  </tr>
                </thead>
                <tbody>
                  <tr class="">
                    <td data-label="Original Edit Block Label" class="slds-cell-wrap" style="vertical-align:top;" headers="d48503e384 ">
                      <div><img src="https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/omnistudio/images/owc_edit_block_label_og.png" alt="An image of the original, unedited label"></div>
                    </td>

                    <td data-label="Custom Edit Block Label" class="slds-cell-wrap" style="vertical-align:top;" headers="d48503e390 ">
                      <div><img src="https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/omnistudio/images/edit_block_card_label_lwc.png" alt="An image of the custom label where the background color is changed to green from the original blue"></div>
                    </td>

                  </tr>
                </tbody>
              </table>
2. In the LWC's JavaScript file, extend the Edit Block Label LWC. Using this code example, replace the NS with the namespace of the package. For information on finding the namespace, see [View the Namespace and Version of Managed Packages](https://help.salesforce.com/s/articleView?id=xcloud.os_viewing_the_namespace_and_version_of_the_omnistudio_vlocity_package_8315.htm&release=264.0.0&type=5 "Omnistudio can be installed as a managed package. The package might be for a Cloud product (such as Insurance or Communications) or Omnistudio Foundation. You can check the namespace and version of your managed package, which you might need for planning upgrades or troubleshooting.").
    
    Example:
    
    ```
    import omniscriptEditBlockLabel from "NS/omniscriptEditBlockLabel";
        import template from "./editblockLabelCustomize.html"
        export default class editblockLabelCustomize extends omniscriptEditBlockLabel{
            // your properties and methods here
            
            render()
              {
                return template;
              }
        }
    ```
3. Add code to the custom LWC.
4. Deploy the custom LWC to Salesforce. See [Deploy Lightning Web Components](https://help.salesforce.com/s/articleView?id=xcloud.os_deploy_lightning_web_components_58289.htm&release=264.0.0&type=5 "Deploy new Lightning web components or change existing components from your local development environment with Visual Studio and Salesforce DX or IDX Workbench.").
5. Go to the Omniscript that contains the Edit Block LWC.
6. In the Edit Block's properties, select **Edit Block Mode**, and click **Cards** or **LongCards**.
7. In the Edit Block's **Edit Block Label LWC Component Override** field, enter the name of the custom LWC.
8. Activate the Omniscript, and preview your changes.

## Extend the Edit Block New LWC

Customize an LWC Edit Block's new entry card by extending the Edit Block New LWC. Exclusive to the Card edit mode, the Edit Block New LWC overrides the new entry card.

1. In VisualStudio, create a custom LWC and make a change such as changing the color of the New button to green.
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
                <colgroup>
                  <col>
                  <col>
                </colgroup>
                <thead class="slds-text-title_caps ">
                  <tr class="">
                    <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d48503e547">
                      <p style="margin-bottom:0;">Original Edit Block New Card</p>
                    </th>
                    <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d48503e553">
                      <p style="margin-bottom:0;">Custom Edit Block New Example</p>
                    </th>
                  </tr>
                </thead>
                <tbody>
                  <tr class="">
                    <td data-label="Original Edit Block New Card" class="slds-cell-wrap" style="vertical-align:top;" headers="d48503e547 ">
                      <div><img src="https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/omnistudio/images/owc_edit_block_card_new_og.png" alt="An image of the original Flexcard with the standard Edit Block"></div>
                    </td>

                    <td data-label="Custom Edit Block New Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d48503e553 ">
                      <div><img src="https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/omnistudio/images/edit_block_card_new_lwc.png" alt="An image of the custom edit block where the text New is in green as opposed to the original blue."></div>
                    </td>

                  </tr>
                </tbody>
              </table>
2. In the LWC's JavaScript file, extend the Edit Block New LWC.
    
    Using this code example, replace the NS with the namespace of the package. For information on finding the namespace, see [View the Namespace and Version of Managed Packages](https://help.salesforce.com/s/articleView?id=xcloud.os_viewing_the_namespace_and_version_of_the_omnistudio_vlocity_package_8315.htm&release=264.0.0&type=5 "Omnistudio can be installed as a managed package. The package might be for a Cloud product (such as Insurance or Communications) or Omnistudio Foundation. You can check the namespace and version of your managed package, which you might need for planning upgrades or troubleshooting.").
    
    Example:
    
    ```
       import omniscriptEditBlockNew from "NS/omniscriptEditBlockNew";
        import template from "./editblockNewCustomize.html"
        export default class editblockNewCustomize extends omniscriptEditBlockNew{
            // your properties and methods here
            render()
              {
                return template;
              }
        }
    ```
3. Add code to the custom LWC.
4. Deploy the custom LWC to Salesforce. See [Deploy Lightning Web Components](https://help.salesforce.com/s/articleView?id=xcloud.os_deploy_lightning_web_components_58289.htm&release=264.0.0&type=5 "Deploy new Lightning web components or change existing components from your local development environment with Visual Studio and Salesforce DX or IDX Workbench.").
5. Go to the Omniscript that contains the Edit Block LWC.
6. In the Edit Block's properties, click **Edit Block Mode** and select **Cards**.
7. In the Edit Block's **Edit Block New LWC Component Override** field, enter the name of the custom LWC.
8. Activate the Omniscript, and preview your changes.