Walkthrough: Setting contact and interaction facets
This walkthrough is part two of the Extending the xConnect collection model walkthrough series. To complete this walkthrough, you must first complete walkthrough part one.
The Sitecore default facets are listed in the collection model reference documentation.
If a facet requires any properties, you must pass them by the facet constructor. If the property is not in the constructor, it is not mandatory.
This walkthrough describes how to:
-
Set a facet on a contact
-
Set a facet on an interaction
Set a facet on a contact
To set a facet on a contact:
-
In Visual Studio, in Solution Explorer, double-click the
Program.csfile and replace the content with the following code: -
Edit the
CERTIFICATE_THUMBPRINTand theXCONNECT_URLconstants. -
Save the
Program.csfile. -
Press F5 to run the app. If the connection is established, the app writes the following in the terminal:
-
The contact identifier.
-
That the facet was set on the contact.
-
That the contact was added.
-
That the interaction with the event was added.

-
Set a facet on an interaction
To set a facet on an interaction:
-
In Visual Studio, in Solution Explorer, double-click the
Program.csfile and replace the content with the following code: -
Edit the
CERTIFICATE_THUMBPRINTand theXCONNECT_URLconstants. -
Save the
Program.csfile. -
Press F5 to run the app. If the connection is established, the app writes the following in the terminal:
-
The contact identifier.
ImportantMake a note of the contact identifier. You need it in the next walkthrough.
-
That the facet was set on the contact.
-
That the contact was added.
-
That the facet was set on the interaction.
-
That the interaction with the event was added.

-
Go to the next walkthrough to learn how to get contact.