0

I want to get the channels information in the listmanager export report. I've created the contactreader and in the contact object, I'm not able to get the channels info.

Do I need to write any code to get the channels from XConnect API?

public class LeadSourceExportAccess : IContactDataReader
{
    public string FacetName => CustomFacetInformation.DefaultFacetKey;

    public string Map(Contact contact)
    {
       string LeadSourceAccess = string.Empty;
        try
        {
          var LeadSourceInformation = contact.GetFacet<CustomFacetInformation>(CustomFacetInformation.DefaultFacetKey);
           LeadSourceAccess = LeadSourceInformation.LeadSource ?? string.Empty;                
         }
         catch (Exception ex)
         {
            Sitecore.Diagnostics.Log.Error(ex.Message, ex, this);
          }
          return LeadSourceAccess;
     }
}
2
  • 1
    A channel is on the interaction, meaning 1 to many. Do you just want to get the 1st interactions channel? Or is it on your custom facet "CustomFacetInformation"? – Chris Auer Aug 12 '20 at 19:21
  • @ChrisAuer Thanks for the prompt response. I want to get all the channels of contact interactions. In the above code, I'm able to get the contact object but not able to find any object related to channels. Could you please share some thoughts on how to achieve the task – Shailesh Aug 13 '20 at 9:54

Your Answer

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

Browse other questions tagged or ask your own question.