You can create and use questionnaires in Pega Retail Advisor to gather information and solicit feedback from your customers. Questionnaires can include text, radio buttons, and drop-down questions.By default, the application includes the following sample questionnaire classes that you can use to create new questionnaires to meet your business needs:
- Use this class to gather basic information about what kind of product the customer needs.
- Use this class to gather feedback from the customer during a retention negotiation.
- Log in by using an administrator account. Dev Studio opens.
- Create a new class for the questionnaire.
- In the Dev Studio header search text field, search for and select the questionnaire class that you want to use as a template, for example, PegaMKT-Advisor-Data-Questionnaire-NeedsAssessment.
- Click Save as.
- In the Class Name field, enter a name for the new questionnaire that begins with PegaMKT-Advisor-Data-Questionnaire-.
- In the Add to ruleset field, select your implementation ruleset.
- Click Create and open.
- In the Explorer panel, click App and search for the questionnaire class for which you want to add a question.
- Right-click the questionnaire class name and then click .
- Enter a Label for the property and click Create and Open.
- Specify the Property type and Table
type. You can set the Table type to Local List, Field Value, Class Key Value, Remote List, or Prompt List. As a best practice, use either Field Value or Prompt List because these modes support localization.
- Add the list of possible answers. For more information, see Property form Completing the General tab.
Note: If the answer text in a property is longer than 64 characters, create a field value for each answer.
- Save the property into your implementation ruleset and ensure that it applies to the questionnaire class for which you are adding the question. For more information, see Properties - Completing the Create, Save As, or Specialization form.
- Repeat steps 4 through 8 for each question that you want to add to the questionnaire.
- Create a section for the questionnaire.
- In the Dev Studio header search text field, search for and select the questionnaire section that applies to PegaMKT-Advisor-Data-Questionnaire-NeedsAssessment.
- Edit the section by adding and removing controls based on the sample to meet your
business needs. Ensure that each answer references the appropriate property that you
created in steps 4 through 8. For more information on configuring sections, see Section form - Completing the Design tab.
Note: Use the following types of controls for questionnaire answers: Text Input, Radio Buttons, and Drop-down.
- Save the section into your implementation ruleset and ensure that it applies to the questionnaire class that you created in step 2. For more information, see Sections - Completing the Create, Save As, or Specialization form.
- Update the service intent task class for which you are adding the questionnaire.
- Create a property named AdvisorQuestionnaire under the intent task class. Set the Property type to Single Page and specify the -Questionnaire class in the Page definition field.
- To display multiple questionnaire sections, copy the PegaMKT-Advisor-Work.DisplayQuestionnaire into the intent task class. By default, this flow supports one section. Add an assignment shape for each questionnaire section and create a backing flow action for each shape.
- Each flow action should reference the corresponding question section in the questionnaire class. Use the AdvisorQuestionnaire page property under the intent task class to switch context to the questionnaire class.
- Provide questionnaire context to Next-Best-Action decisions.
- To pass the responses to questionnaire questions as context to Next-Best-Action decisions, copy the MapQNAToContext data transform to the questionnaire class.
- Add an entry to the Response.Contexts page list for each
question. For each entry, set values for the following fields.
- Set .Type equal to "QnA".
- Set .Key to the identifier of the question.
- Set .Value to the value (that is, the response) of the question.
- Click Save.