Exporting Custom Definition Data in Sitecore Content Hub - (Part 6)

Continuing our Sitecore Content Hub series from earlier blogs, including our latest on Adding a Selection Component, this guide specifically addresses exporting data from custom-defined entities using Export Profiles and Selection Components. This detailed step-by-step tutorial is designed for developers and technical teams responsible for managing and exporting structured custom data.


Prerequisites

  • Access to Sitecore Content Hub with administrative privileges.
  • Existing custom definition configured (e.g., "MarketingCampaign").

Technical Scenario Recap

Continuing our established scenario, we'll focus on exporting data from the custom definition:

  • Definition: MarketingCampaign
  • Properties: CampaignName, StartDate, EndDate, Location, CampaignStatusActive
  • Relations: None required for this export scenario, but relations can be added if needed by specifying the relation names.

Step-by-Step Implementation

Step 1: Creating an Export Profile

1. Navigate to: Manage → Export Profiles


2. Click ➕ Add Export Profile.


3. In the modal popup, configure:

    • Name: Export Custom Marketing Data
    • Definition: Select MarketingCampaign


4. In the Settings JSON configuration, define the specific properties to export:
{
  "properties": [
    "CampaignName",
    "StartDate",
    "EndDate",
    "Location",
    "CampaignStatusActive"
  ],
  "relations": {},
  "includeSystemProperties": false,
  "version": "1.1"
}


Important Note:

  • To explicitly export only the necessary properties, relations must be empty ("relations": {}) and exclude system-generated properties ("includeSystemProperties": false).


Step 2: Configuring the Selection Component

Continuing from the previous selection component setup:


1. Navigate to: Pages → Marketing Campaigns. 



2. Edit the existing Selection Component:

  • Enable the toggle ✅ Enable Export to Excel under General Settings.


3. In the Export Excel Settings tab:

  • Choose MarketingCampaign as the Definition.



  • Click ➕ Add Export Profile and select Export Custom Marketing Data.



4. Save your changes.

Step 3: Performing Data Export

Once configured:

1. Users select entities on the Marketing Campaigns page.



2. Click the newly available Export to Excel button.





3. Monitor the export task, and upon completion, download the Excel file from the Downloads area.




Step 4: Validate Exported Data

1. Open the Excel sheet.



2. Ensure all entities and their respective properties are correctly listed, aligning with your configured export profile.


Best Practices & Considerations

  • Maintain clear naming conventions for export profiles to easily manage and reuse profiles.
  • Regularly verify your export configuration to ensure accuracy with evolving custom definitions.
  • Ensure the "relations" parameter is explicitly defined as empty {} to avoid unintended data inclusion.

Conclusion

Exporting custom definition data enhances your ability to utilize Sitecore Content Hub effectively for tailored business scenarios. Through these structured export capabilities, one can seamlessly manage data extraction tasks, ensuring efficiency and consistency across digital asset workflows.

Stay tuned for our upcoming blogs for more deep technical insights and best practices! :)

Post a Comment (0)
Previous Post Next Post