---
schema_version: "1"
id: 6a787bb8655bc2619980eda7bc4fb7ac9ab3f2607190ad5c98bfbf94d86b93da
title: Create a Personalized Email with Custom Object Data
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/mktg/264-0-0/mc_co_personalized_email_with_custom_object_data.md
canonical_url: https://help.salesforce.com/s/articleView?id=mktg.mc_co_personalized_email_with_custom_object_data.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: f8eb59cfa99b69dc3276e898e938c0f36db76ca2a84cf1b9790aa47d51af637c
description: For this Marketing Cloud Connect for Marketing Cloud Engagement tutorial example, create a personalized email from a case with custom object data using AMPscript.
products:
  - Marketing
  - Cross Cloud
release: "264"
---
# Create a Personalized Email with Custom Object Data

For this Marketing Cloud Connect for Marketing Cloud Engagement tutorial example, create a personalized email from a case with custom object data using AMPscript.

Assume that you have a custom object called Application with a lookup to the Contact object. The Application custom object has two fields: University\_Name\_\_c and Course\_Name\_\_c.

1. In Engagement, go to Email Studio.
2. Click **Content**.
3. Click **Create**.
4. Select **HTML Paste**.
5. Enter an email name and subject line.
6. In the email content area, insert this AMPscript.
    
    ```html
    %%[
    
        Set @mySObject = SObjectSet
    
            @myRecordId = RecordIdset
    
            @Application = RetrieveSalesforceObjects(@mySObject,"University_Name__c,Course_Name__c","Id", "=", @myRecordId)
    
        
    
        Set @ApplicationRow = Row(@Application, 1)
    
        Set @University_Name = FIELD(@ApplicationRow, "University_Name__c")
    
        Set @Course_Name = FIELD(@ApplicationRow, "Course_Name__c")
    
    ]%%<br>
    
    <br>SObject From API Call: %%=v(@mySObject)=%%
    
    <br>RecordId From API Call: %%=v(@myRecordId)=%%
    
    <br>University Name From RetrieveSalesforceObjects: %%=v(@University_Name)=%%
    
    <br>Course Name From RetrieveSalesforceObjects: %%=v(@Course_Name)=%% <br>
    
     
    
    
    ```
    
    When referencing custom object fields, include the Sales Cloud field name and the underscore \_. For example, University\_Name\_\_c.
7. Save the email.