Interaction.ShowSurvey
Method | |
---|---|
Module | Interaction |
Library | Core |
Action | Display a pop-up survey to one or more user sessions. The pop-up includes questions text followed by a set of selectable choices, and an optional free text box. |
Parameters |
If set to |
In synchronous mode the method will only return once all user sessions have responded or have timed out. In asynchronous mode, the method returns immediately and results will appear as events as user sessions respond or timeout. | |
The table consists of rows of Text strings, and optionally a Color value. An Icon may also be optionally associated with each entry. The Color value can be either a RGB hex code such as '#bf930f' or a color description such as 'blue'. The Icon can be specified based on the list shown in the notes section below. The order of the choices determines the response value that is returned when a choice is made; for details see | |
| |
| |
| |
This is used to uniquely identify the survey, and prevent repeat showing of the same survey. | |
| |
The maximum value allowed is 129600 minutes (90 days). Default is 0 which means survey maximum validity period of 90 days will apply. Response validity is a way to avoid repeatedly presenting a user with the same survey. When a user provides an answer to a survey, the response they give is deemed to be "valid" for the duration specified here. You may then use the Interaction.GetActiveResponsesmethod to test whether there is already a valid answer for a particular user/survey; if there is, you may wish to avoid calling Interaction.ShowSurvey and instead use their existing answer. Once the response validity period has elapsed, the response is no longer marked as valid, and will not appear in the table returned by Interaction.GetActiveResponses. You can force the one or more responses to be invalidated for a user/survey immediately by using the Interaction.InvalidateResponse method. | |
Minimum value is 30 seconds, maximum value is 900 seconds. | |
In synchronous mode this is not relevant and should not be supplied. | |
| |
Return values |
|
| |
Values are: "dismissed", "responded", "snoozed", "timed out", "invalid". | |
The highest ordered choice (first in the table of choices) will have a response value of 1. The lowest ordered choice (last in the table of choices) will have a response value of 0. Those in between will be allocated a fractional value between 1 and 0 relative to their position. For example, if the choices are: (Great, Good, Average, Poor, Terrible) then these will be scored: Great=1.0, Good=0.75, Average=0.5, Poor=0.25, Terrible=0. | |
| |
Example | @a = SELECT "Very Happy" AS Text, "green" AS Color, "far-fa-grin-squint" AS Icon UNION ALL SELECT "Happy" AS Text, "#bf930f" AS Color, "far-fa-smile" as Icon UNION ALL SELECT "Indifferent" AS Text, "blue" AS Color, "far-fa-meh" as Icon UNION ALL SELECT "Quite unhappy" AS Text, "orange" AS Color, "far-fa-frown" as Icon UNION ALL SELECT "Very Unhappy" AS Text, "red" AS Color, "far-fa-tired" as Icon; // Synchronous survey to a single user session. Interaction.ShowSurvey(Async:false, Choices : @a, Name:"User Experience Survey", Question : "How happy are you with your user experience?", UserName:"acme\\development", AllowFreeText: true, FreeTextLabel: "Please elaborate"); // Asynchronous survey to all user sessions on this device and include a free text box. Interaction.ShowSurvey(Async:true, Choices : @a, Name:"User Experience Survey", Question : "How happy are you with your user experience?", AllowFreeText: true, FreeTextLabel: "Please elaborate", Topic:"MyExperienceSurvey"); |
Platforms |
|
Notes | In order of appearance, these are: far-fa-grin-squint.png far-fa-smile.png far-fa-meh.png far-fa-tired.png far-fa-frown.png fas-fa-battery-full.png fas-fa-battery-three-quarters.png fas-fa-battery-half.png fas-fa-battery-quarter.png fas-fa-battery-empty.png far-fa-hourglass.png fas-fa-hourglass-start.png fas-fa-hourglass-half.png fas-fa-hourglass-end.png far-fa-hourglass-o.png fas-fa-thermometer-full.png fas-fa-thermometer-three-quarters.png fas-fa-thermometer-half.png fas-fa-thermometer-quarter.png fas-fa-thermometer-empty.png fas-fa-thumbs-up.png fas-fa-thumbs-down.png fas-fa-laptop.png fas-fa-video.png fas-fa-headset.png fas-fa-mouse.png fas-fa-desktop.png fas-fa-keyboard.png |