Mytutorialrack

Data Cloud

Salesforce has released an update to Data Cloud that lets you directly upload files and attachments from any Salesforce object. In this blog post, we’ll explain the whole process step by step.

Ingest content documents that you’ve added as file attachments to standard and custom Salesforce objects so that you can index them for search. All relevant content in the attachments is chunked and turned into searchable vectors, improving the efficiency and comprehensiveness of search operations within generative AI, analytics, and automation apps.

User Permissions

To ingest content document data, you must have one of the following permission sets:

  • Data Cloud Admin
  • Data Cloud Marketing Admin
  • Data Cloud Data Aware Specialist

Additionally, make sure you have the following permissions set up:

  • Setup -> Permission Sets -> Data Cloud Salesforce Connector -> App Permissions -> Content -> Query Non Vetoed Files
  • Setup | Permission Sets -> Data Cloud Salesforce Connector -> App Permissions -> Allow View Knowledge for Knowledge Attachment Ingestion
  • Setup -> Salesforce Files -> General Settings -> Salesforce Files Settings -> Enable Files to be ingested into Data Cloud
  • Setup | Installed Packages -> Confirm your SSOT version is 1.68 or higher.

Creating Data Streams for Content Object

Data Cloud uses three key content data streams to ingest file attachments:

  • ContentDocument: Represents a document uploaded to a Salesforce library.
  • ContentVersion: Represents a specific version of a document.
  • ContentDocumentLink:Represents the link to entities that the file is shared with, whether it’s users, groups, records, or libraries.

This process requires that you first create three content data streams: ContentDocument, ContentDocumentLink, and ContentDocumentVersion. After creating the data streams, any files you attach to standard or custom Salesforce objects are automatically ingested into Data Cloud. If you have existing content data streams that you previously set up, you need to recreate these streams to trigger file ingestion. If you have existing file attachments on Salesforce Objects, re-add them to your Salesforce objects to ensure they are ingested into Data Cloud.

Steps For Creating Data Streams

  1. In Data Cloud, go to the Data Streams tab and click New.
  2. Select Salesforce CRM as your data source and click Next.
  3. Choose your Salesforce org by clicking All Objects (if you have multiple orgs, select the correct one).
  4. Pick Content Document and click Next.
  5. Review the fields for the objects that are included in your data stream, deselect the fields that aren’t required for your data stream, and clickNext.
  6. If you get an error that the label for the field with the API name SharingOption is too long, either edit that field label for a shorter name or deselect it. If that the field label for the field with the API name SharingOption is too long. Either edit that field label or deselect it.
  7. Select either the Profile or Other category (avoid the Engagement category).
  8. Review and then click Deploy.
  9. Repeat these steps for the Content Version and Content Document Link objects.

After deployment, verify that the ContentDocument, ContentVersion, and ContentDocumentLink data lake objects (DLOs) are listed in your Data Lake Objects.

Map the Content Object Data Streams with DMOs

  • Map the ContentDocument and ContentDocumentLink DMOs to their corresponding objects.
  • The mapping for the ContentVersion DMO happens automatically.

Creating Data Streams for Salesforce Object

  1. In Data Cloud, go to the Data Streams tab and click New.
  2. Select Salesforce CRM as your data source and click Next.
  3. Choose your Salesforce org by clicking All Objects (if you have multiple orgs, select the correct one).
  4. Pick the object from which you want to upload files and attachments and click next.

Map this data Stream corresponding to its DMO,ensuring that the primary key of the DMO is mapped correctly.

Configure Object Relationships

Ensure a relationship exists between the object DMO (e.g., Case, Opportunity, Account, or your custom object DMO) and the ContentDocumentRelationship DMO. Follow these steps:

  • 1. Go to the ContentDocumentRelationship DMO page and select the Relationships tab.
  • 2. Click on Edit >> Create New Relationship.
  • 3. “Object Content Document Relationship” is already selected.
  • 4. Select “Content Document Related Item” under the field.
  • 5. Set the cardinality as ManyToOne.
  • 6. Under “Related Object from Data Cloud,” select your DMO (e.g., Prescriber_Enrollment__c_Home).
  • 7. Select your primary key under the related field of your selected DMO.

Now , create a vector search index configuration that includes file attachments for the Salesforce objects (e.g., Prescriber_Enrollment__c_Home).

Conclusion

In summary, by following these steps, you can easily ingest and index file attachments from Salesforce into Data Cloud without using any external sources like (AWS and many more) making your data more searchable and empowering your analytics and automation efforts.

You can deepen your understanding of Data Cloud by exploring our comprehensive course on Salesforce Data Cloud and Agentforce – Building Agents and also check out our latest blogs on our websites for additional knowledge about salesforce.

Share:

Recent Posts