1

I'm using sitecore 9.1.1

I'm trying to get contact who's first name is "myfirstnametest" but I'm getting count zero in result for contacts even I have record with this contact facet.

using (Sitecore.XConnect.Client.XConnectClient client = Sitecore.XConnect.Client.Configuration.SitecoreXConnectClientConfiguration.GetClient())
            {
var results3 = client.Contacts.Where(c => c.GetFacet<PersonalInformation>().FirstName == "myfirstnametest").GetBatchEnumerator();
}
2

Like Raman said, you need to make sure you are index PII information before it can show up.

Also you query should be like this

client.Contacts.Where(x => x.Personal().FirstName == "Tommy")
  .WithExpandOptions(new ContactExpandOptions(PersonalInformation.DefaultFacetKey))
  GetBatchEnumerator();
1

The Experience Profile and List Manager interfaces rely on personal data being available in the xDB index. As the FirstName facet is marked as [PIISensitive], you will not be able to use it by default.

To use contact facets marked [PIISensitive] in the custom predicate, please enable indexing of PII sensitive data in the xDB index.

I am able to see the segmented list based on FirstName after I enabled the indexing of PII sensitive data in the xDB index.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.