You have two ways to achieve this:
Option 1. Create a custom facet to store newsletter consent for the contact and save its value (true/false) on the click of Subscribe button, the same way you're doing to set email facet value. After values are stored in XDB, you can call this custom facet in experience profile code and store its value in DataTable.
If you go with the second option (real Contact instance), you can use reflection (e.g. ReflectionUtil) to set FacetMap property on the contact instance.
FacetMap is then used by Facets and GetFacet calls.
public void Test1()
var contact = new Contact();
var facetMap = new Dictionary<string, Facet>();
You can use XDB migration tool to migrate data from MongoDB to xDB. To migrate complex and custom types, you must register a custom migration model.
1. The first step is to create a model in xConnect: In the older version (8.x), you might have a facet class implemented from IFacet, now in 9.x you need to create a custom facet model class implementing from ...
Sitecore XConnect provides some default collection models to save user data like Personal Information, Email, Address, etc. the complete list you can find in an assembly named Sitecore.XConnect.Collection.Model.dll.
You need to perform the below-mentioned steps to create custom facets in Sitecore.
Create a Custom Facet Model
Register the Custom Facet Model
Got this response from Sitecore Support:
The reported issue is the result of the following error on xConnect CollectionSearch instance:
[Error] Sitecore.XConnect.Operations.XdbSearchOperation`1[Sitecore.XConnect.Contact]: System.NotSupportedException: Contact.Interactions is not currently supported in Azure
I also got same issue, my site is in sitecore 10.0. Previously my application was working fine but problem started as certificate got renewed.
Make sure all your three sites should have proper license.
Below given default license path details:
For Identity Server, its in \sitecoreruntime folder
For xconnect site ,its in \App_Data and subfolders of App_Data\...