ÃÛ¶¹ÊÓƵ

Extend a schema extend-schemas

As a technical user, you can customize Campaign datamodel to meet the needs of your implementation: add elements to an existing schema, modify an element in a schema or delete elements.

Key steps to customize Campaign datamodel are:

  1. Create an extension schema
  2. Update Campaign database
  3. Adapt the input form
CAUTION
Built-in schema must not be modified directly. If you need to adapt a built-in schema, you must extend it.

For a better understanding of Campaign built-in tables and their interaction, refer to this page. See also recommendations when creating a new schema in this page.

To extend a schema, follow the steps below:

  1. Navigate to the Administration > Configuration > Data schemas folder in the Explorer.

  2. Click the New button and select Extend the data in a table using an extension schema.

  3. Identify the built-in schema to extend and select it.

    By convention, name the extension schema the same as the built-in schema, and use a custom namespace. Note that some namespaces are internal only. Learn more

  4. Once in the schema editor, add the elements you need using the contextual menu, and save.

    In the example below, we add the MembershipYear attribute, put a length limit for last name (this limit will overwrite the default one), and remove the birth date from the built-in schema.

    code language-none
    <srcSchema created="YYYY-MM-DD" desc="Recipient table" extendedSchema="nms:recipient"
            img="nms:recipient.png" label="Recipients" labelSingular="Recipient" lastModified="YYYY-MM-DD"
            mappingType="sql" name="recipient" namespace="cus" xtkschema="xtk:srcSchema">
     <element desc="Recipient table" img="nms:recipient.png" label="Recipients" labelSingular="Recipient" name="recipient">
        <attribute label="Member since" name="MembershipYear" type="long"/>
        <attribute length="50" name="lastName"/>
        <attribute _operation="delete" name="birthDate"/>
    </element>
    </srcSchema>
    
  5. Disconnect and reconnect to Campaign to check schema structure update in the Structure tab.

  6. Update the database structure to apply your changes. Learn more

  7. Once changes are implemented in the database, you can adapt the recipient input form to make your changes visible. Learn more

recommendation-more-help
35662671-8e3d-4f04-a092-029a056c566b