Embedded Profile Definitions

You can create a relationship between two profile definitions by embedding one profile definition in another. This relationship is used to create profiles that are related to each other. You can create up to four levels of embedded profile definitions to limit client resource usage. As a site developer, you can configure more than four levels.

With embedded profile definitions, you can:

  • Embed one profile definition per profile property.
  • Create multiple properties that are defined as embedded profile definitions within a single profile definition.
  • Define a property of type profile as multi-valued to collect multiple instances of the profile data with that property.
  • Define a property of type profile as single-valued to collect only one instance of the profile data with that property.

For example, you can add a multi-valued property named Employees to the Organization profile definition, and use the User Object profile definition as the type reference for the Employees property. You can use this structure to collect the profile data for all of the employees in an organization.

Multiple values for a profile property are stored in the mapped database column as a semicolon (;) separated string.

To be able to search and update an Organization user profile, add the organization name to the user profiles created with the Employee property in the Organization profile definition.

If you add a single-valued property named Address to the User Object profile definition, with the Address profile definition as the type reference, you can then collect an address for each set of user data you collect with the Employee property in the Organization profile definition. You can edit up to four levels of profiles.

If you are collecting specific variations of the same type of data, for example, shipping and billing addresses for each user, create a profile property for each address type. This makes it easier to identify which address you are editing when you access the addresses from inside the user profile.

After you have updated the profile definition and used the Publish Profiles module to update the profile definition information on your Web site, your Web site designer can use the GetProfile or GetProfileByKey method to retrieve the ProfileObject objects corresponding to the specified primary key value and schema type of the embedded address profile definitions, and add the properties of the Address profile definition to your Web site.

After the Address profile definition has been added to your Web site, you can use the primary keys collected in the address properties of the user profile from the associated address profiles to view address profile data with the associated user profile data.

Embedding the Address profile definition and the User Object profile definition

You embed profile definitions to create a relationship between two profiles. For example, you can create a relationship between the Address profile definition and the User Object profile definition. There are two ways you can extend the User Object profile definition to collect address information:

  • Embed the Address profile definition in the User Object profile definition
  • Add address profile properties to the User Object profile definition

The following table shows a relationship created by embedding the Address profile definition in the User Object profile definition. When the user, Sean Chai, fills out his address information, the primary key of the address profile associated with him becomes the value of the Billing Address property of his user profile. (See bold text.)

User Object profile definition property Value for property in user profile Address profile definition property Value for property in address profile
Name SeanChai Address ID Address.SeanChai
Billing Address (embedded Address profile definition) Address.SeanChai Street 1234 Main Street

When you embed the Address profile definition in the User Object profile definition, you create a relationship between a user profile and an address profile for each user who registers on your Web site and provides address information.

You can embed more than one profile definition in a single profile definition, so you can easily use this technique to collect more than one address from each user, such as a shipping address and a billing address. With an embedded profile definition you can also define a property as multi-valued to collect multiple versions of the profile data with that property.

For information about embedding a profile definition, see Embedding Profile Definitions.

See Also

Adding Properties to a Profile Definition

Adding a Property that Maps to a Site Term

Deleting Properties from a Profile Definition

Embedding a Profile Definition

Copyright © 2005 Microsoft Corporation.
All rights reserved.