Loading

Extract Parent ID of ContentNotes Object in Salesforce

Date de publication: May 7, 2026
Description

Unlike standard Notes, the ContentNote object in Salesforce does not include a Parent ID when you export data using API, Data Loader, or Data Export. Instead, ContentNote relies on the ContentDocumentLink object to establish relationships to other records. This means that to identify which record a ContentNote belongs to, you must perform a two-step export process: first export ContentNote IDs, then query the ContentDocumentLink object to retrieve the parent record IDs (stored in the LinkedEntityId field).
See the ContentNotes ERD diagram to view the ContentNote object relationships.

Résolution

This article explains how to identify the Parent ID for ContentNote records in Salesforce using a two-step process involving Data Export and Data Loader. Since ContentNote uses the ContentDocumentLink object for relationships, you must cross-reference two exports to retrieve parent record IDs.
Step A — Extract ContentNote IDs

  1. Navigate to Setup and enter Data Export in Quick Find.
  2. Select Include Salesforce Files and Salesforce CRM Content document versions.
  3. Deselect Replace carriage returns with spaces.
  4. In the object list, select ContentVersion and start the export.
  5. Download and unzip the export when it becomes available.
  6. Open the ContentVersion .csv file. To filter for ContentNotes data only, apply a filter in Excel for: IsLatest = 1 and FileType = Snote.
  7. Copy this filtered data to a new .csv file and save it.

Step B — Extract Parent IDs of ContentNotes

  1. Open Data Loader and click Export All.
  2. Select Show all Salesforce objects and choose the ContentDocumentLink object.
  3. Choose a target location for the output file.
  4. From the file created in Step A, copy the values in the ContentDocumentId column — these will be used in your query filter.
  5. Run a query on ContentDocumentLink using the ContentDocumentId values from Step A. The query should retrieve: Id, ContentDocumentId, ContentDocument.Title, ContentDocument.FileType, LinkedEntityId, ShareType, and Visibility. Filter by ContentDocumentId values using an IN clause.

    To construct the IN clause efficiently, use the Excel CONCATENATE function to join multiple ContentDocumentId values with commas.
  6. The LinkedEntityId column in the results contains the parent record IDs and owner IDs for the ContentNotes. Filter to show only record values (excluding user IDs).
Numéro d’article de la base de connaissances

000381453

 
Chargement
Salesforce Help | Article