Skip to main content

C4C: Survey data model

Submitted by Stefan Barsuhn on

Surveys in C4C are a bit complicated. Here's a quick overview of the data structure (based on Ticket/ServiceRequest).

  • To get all filled out surveys relating to a ticket, use BusinessTransactionDocumentReference with TypeCode 1876 and BusinessTransactionDocumentRelationshipRoleCode 2
    • This will list distinct surveys added to this ticket
  • One level down, QuestionnaireValuationCollection, will contain one entry per survey.
  • One level down, Valuation will, again, contain 1 entry per survey. I don't have an example at the moment, but I guess if a survey can be filled out multiple times, there would be one entry for each time it's filled out.

Note: all three levels above exist the moment the survey is added to the ticket. But content-wise you could say that BTDR is the link, QVC is the survey and Valuation is the response to that survey

  • On this level (Valuation), there are 2 relevant nodes:
    • ValuationQuestionValuation contains the answer text (what the user typed in as an answer to the question)
      • ValuationQuestionValuation.Element contains some metadata regarding the question (like OrdinalNumberValue, which indicates the position of the question in the survey)
        • ValuationQuestionValuation.Element.ElementDescription contains the question text
        • Note: I don't have a multiple-choice example at the moment, but I guess ValuationQuestionValuation.Element.ElementResponseOption would be the way to go
    • ResponseAttachment contains any answer attachments. On the first node, you just get an ElementUUID, which links to the related question (see ValuationQuestionValuation.Element). This also means that ResponseAttachment contains one entry for each question (that has an attachment).
      • ResponseAttachment.ResponseAttachment. This is a link to the corresponding AttachmentFolder BO. So this also contains only one entry
        • ResponseAttachment.ResponseAttachment.DocumentList. This contains your actual attachments. I.e. if there are 2 attachments to one question, this list would contain 2 entries.

Hope this helps!

Tags