Get Last Survey For Client
Category: Customer Satisfaction
Description: This extension module allows retrieving all historical survey information based on the configured period or count, returning the data in JSON format.
Functionality: Use this extension module to return survey-related information in JSON format for a specific period, starting from the configured period/count and ending on the current date. Obtain all surveys from a specified date up to the present for the client associated with the interaction.
Prerequisites
-
Design Survey Flow:
- Design a survey flow using the Request Entity by Name extension module. In this case, two surveys will be conducted to achieve the desired functionality.
-
Create Entities in Lynn:
- From the flow designer, create the necessary entities to store the results of the surveys that will be conducted.
Implementation
Important ❕: It is essential to have an active survey within the flow for survey information to be available.
Survey Period: This dropdown list field displays the available options corresponding to the period for which the survey information will be requested. The available options include:
- Day
- Week
- Month
- Year
Maximum Number of Surveys in the Period: This field allows selecting the maximum number of surveys that can be generated based on the selected period for extracting the information. Only whole numbers are allowed in this field. Example: If "Month" is selected in the previous option and "1" is entered in this field, this indicates that the historical information to be obtained will cover a maximum of 1 month from the current date.
Entity to Store a Value Indicating the Presence of Data: This dropdown list field allows selecting or creating the entity where the result will be stored. The entity must be of type boolean, indicating "True" if data is found, and "False" otherwise.
Entity to Hold the Response in JSON Format Indicating the Presence of Data: This dropdown list field allows selecting or creating the entity where the result will be stored. The entity must be of type boolean, indicating "True" if data is found, and "False" otherwise.
Implementation Example
Request Entity by Name Extension Module
Field | Value |
---|---|
Name | Survey1 |
Entity Name Obtained from an Expression | 'survey_1' |
Allow Null or Empty Value Obtained from an Expression | false |
Maximum Failed Attempts Obtained from an Expression | 3 |
Invalid Value Message Obtained from an Expression | 'error' |
If the Maximum Failed Attempts Are Reached, the Action Flow Will Be Interrupted and the Error Description Will Be Passed to the Selected Intent Named: 'Request_Entity_Error' | Error_Handler |
Get Last Survey For Client Extension Module
Field | Value |
---|---|
Name | TestSurveyGet |
Survey Period | Day |
Maximum Number of Surveys in the Period | 1 |
Entity to Store a Boolean Value Indicating Whether Results Exist | entityBool |
Entity to Hold the Response in JSON Format Indicating Whether Data Exists | entityTest |
Intent to Execute in Case of Error. The Error Information Will Be Transferred to a Variable Named: Get_Last_Survey_For_Client_Error | Error_Handler |
Below is the result of implementing these extension modules together:
The intent containing the response in JSON format will yield the following result:
[
{
"subLevel": "CustomerSatisfactionSurvey",
"subData": {
"evaluationTitle": "Please help us improve your experience. How would you rate the service you received?",
"conversation": "82620af4-9755-4c2f-9fd2-62e72110d1de",
"evaluationEntity": "SURVEY",
"evaluationValue": "average",
"intent": ""
}
}
]