Setting a default value to the field(smiley) in the survey by passing parameters through survey URL?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2018 11:55 AM
We have a requirement to send a resolution notification with smileys to take the survey. Once the user clicks on any smiley image, then it should redirect to survey form in Servicenow with the selected smiley image as default.
We are using Service Portal "Take_Survey" widget.
Please suggest how we can achieve this by passing parameters in the URL and set values in take_survey widget.
Thanks in Advance..!!
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2020 09:37 AM
Hi Mike ,
Can you please share the code to set Image value based on URL parameter.
Regards
Sweta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2020 08:00 AM
Please let me know if anyone implemented this successfully?? We have same requirement.
Thanks,Jayasri.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2022 11:51 AM
Hello,
Steps to implement this:
-Use mail script to send notification and assign for each emoji a value you can passe using the url for example: &pickedValue=4
-retrieve the information and put it on a variable on server side widget like this one:data.pickedValue=$sp.getParameter('pickedValue')||'';
-Go to the widget angular provider spSurveyImageScale, you can find it under the section angular provider on related list widget click on spSurveyField then you will find spSurveyImageScale on the related list, go to the function var unselectAllChoices = function(firstLoad) this should be set like bellow:
var unselectAllChoices = function(firstLoad) {
for (var i=0; i < $scope.field.choices.length; i++) {
var choice = $scope.field.choices[i];
if (i==$scope.c.data.pickedValue)
$scope.field.value = choice.value;
else
unselectChoice(choice, firstLoad);
}
Mark this as correct if it helps!