Copying Fields From an Organization to Another

Members of the Administrators and Content Managers built-in groups can create fields in a Coveo Cloud organization (see Adding and Managing Fields). Once you have created fields in your sandbox organization and are satisfied with the results, you want to reuse them in your production organization (see About Non-Production Coveo Cloud Organizations).

Instead of manually recreating the fields in your production organization, you can export and import fields using the Coveo Cloud Field API. The following procedure indicates how to read your fields from a given organization and write them in another one.

To import fields from an organization (A) into another (B), you must:

  1. Retrieve the JSON configuration of each field you want to copy from organization A.

  2. Recreate organization A fields in organization B.

Step 1 - Retrieve Organization A fields

  1. Access the List fields operation of the Field API.

  2. On the right-side of the operation section, click the red exclamation mark icon to log in to Coveo Cloud and prove you have the right to perform the operation.

    AuthenticationButton

  3. On the organizationId row, in the Value column input, enter the ID of organization A (see Organization ID and Other Information).

  4. On the Origin row, in the Value column, click the drop-down menu, and then select USER.

    You cannot import system fields. For further information on fields, see Understanding Fields.

  5. At the bottom of the operation section, click the Try it out! button.

    In the Response Code box, when you see 200, the JSON configuration of each retrieved field in organization A is displayed in the Response Body of the operation.

    • Be default, the Field API lists 100 fields per page. You can, however, change this value on the perPage row.

    • On the page row, you can also access other pages of listed fields. Note that 0 is equivalent to the first page.

    • If you want to retrieve specific fields, you can refine the fields listed in the Response Body of the operation using the filter, sortBy, and type filtering parameters.

  6. Copy the configuration of the fields you want to reuse in organization B.

Step 2 - Recreate Organization A Fields in Organization B

  1. Access the Create fields operation of the Field API Swagger. You may need to log in to Coveo Cloud again.

  2. In the fieldModels row, in the box, paste the configuration of the fields you want to import.

    • At the top of the JSON configuration, remove items, and at the bottom, remove both the totalPages and totalEntries sections.

    • Ensure that you respect JSON syntax. The Example Value displayed on the fieldModels row.

  3. On the organizationId row, in the Value column, enter the ID of organization B (see Retrieving the ID of a Coveo Cloud V2 Organization).

  4. At the bottom of the page, click the Try it out! button.

    In the Response Code box, when you see 201, the fields are created in organization B.

  5. In the Coveo Cloud administration console, access the Fields page of organization B, and then ensure that the imported fields are displayed in the table.

What’s Next?

Once the fields are created in organization B, you will probably want to manage the mappings (see Adding and Managing Source Mappings).

Recommended Articles