How to Include Public Asset URLs in Sitecore Content Hub's Default Excel Export Settings

Hello, Sitecore enthusiasts out there!👋 In today's blog, we're going to learn how to include public asset URLs in the default Excel export settings of Sitecore Content Hub. 

When you use the export to Excel feature, it includes all fields in the output file by default. To specify exactly which fields to include, you need to create export profiles. In our use case, we want to include publicly accessible URLs in our Excel sheet when exporting our assets.


Creating an export profile in Sitecore Content Hub to include asset public media URLs in your Excel exports is straightforward. Here’s how to do it:


1. Log in to Sitecore Content Hub: Access your account with admin or superuser privileges. Proper permissions are required to make changes.

2. Access Export Profiles: After logging in, navigate to the 'Manage' ⚙️ and select Export Profiles.



3. Create a New Export Profile: Click on the ➕ Export Profile button on the top right side.

4. Configure Your Export Profile: In the pop-up that appears, enter the name of your export profile and select the entity definition for the export. For assets, you'll use Asset (M.Asset). If you want this profile to be the default for the selected entity definition, make sure to check the corresponding box. Then, configure the JSON settings as follows:

{
  "properties": [
    "Title",
    "Description",
    "FileName"
  ],
  "relations": {
    "FinalLifeCycleStatusToAsset": {
      "exportRelatedEntities": false
    },
    "ContentRepositoryToAsset": {
      "exportRelatedEntities": false
    }
  },
  "includeSystemProperties": true,
  "publicLinks": {
    "asset": true,
    "masterfile": true
  },
  "version": "1.1"
}


5. Save the Export Profile: Click 'Save' to finalize the creation of your export profile.

6. Select Assets for Export: Navigate to the Assets Page and select the assets you wish to export to Excel. Ensure each selected asset has a public URL created; if not, create one following these steps:
  • Creating a Public Link for an Asset: Go to the Asset Page, select the asset for which you want to create the public link, then click on the three dots in the 'All Files' section to find the option to create public links. 

  • A pop-up will appear where the URL path is auto-generated. You can set an expiration date for the public link or leave it unset for the link to never expire. 

  • Save your settings, and a public link will be generated for that asset, marked as 'never expires' if no expiration date is set.
  • You can also generate public links for multiple assets simultaneously. To do this, navigate to the Assets page and select the assets for which you wish to create public links. After selection, click on the "..." dots to reveal more options, and choose "Create Public Links." This action opens a mass edit and public links creation window. Within this popup, you'll find the Public Link section where you can specify the expiration date for these links. Additionally, you have the option to select the rendition of the assets for the public links, with choices including original, preview, and thumbnail. After setting your preferences, simply click 'Save' to generate the public links for your selected assets.



7. Export to Excel: Go back to the Assets Page, select the assets for export, and click on the 'Export to Excel' option.
8. Name and Export the file: Once you initiate the export to Excel, a popup will appear prompting you to enter a name for the export file. After you input the file name and click on "Export," the file will be downloaded automatically, saved with the name you specified.


9. Download the Exported File: When the download is ready, a popup may appear, giving you the option to view or download the file immediately. Alternatively, you can visit https://your-sitecore-instance/en-us/user/myorders to access your downloads at any time. Additionally, you'll receive an email from the marketing content team with a link to download the file directly from there as well.






10. Check the Results: Upon completing the download, you can open the Excel file to review the exported asset data. This file will contain all the properties you specified, including the public link to view the asset media file. Within the section for the master public link, you'll find the public link you added, allowing direct access to each asset's media content.


Important Note: 

To successfully include public links in your Excel exports, you must configure your export profile settings as follows when creating it: 
{
  "publicLinks": {
    "asset": true,
    "masterfile": true
  }
}
In this configuration, the asset parameter is a boolean flag that triggers the export of the completed and active public links for assets. The masterfile parameter triggers the export of the completed and active master file public links. 

It's crucial to verify that the assets you intend to export have public links already created. With these settings in place, exporting your asset data into Excel while incorporating the public URLs of the assets becomes a straightforward process.

Conclusion: 

This walkthrough has shown you the straightforward steps to include public links in your Excel exports of assets from Sitecore Content Hub. By following these guidelines, you ensure that every exported asset is just a click away from its corresponding media content, enhancing the utility of your Excel reports. Stay tuned for more engaging and informative blogs like this one. Keep exploring, keep learning!😊


1 Comments

Post a Comment
Previous Post Next Post