- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2017 12:32 AM
Where can i find the code for task number and short description on take_survey widget?
Solved! Go to Solution.
- Labels:
-
Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2017 07:55 AM
Dear Raveena,
I attempted to implement your requirement and below are the changes needed.
I made a screencast of how the changes look like, url to view the same (ServicePortalSurveyWidget - YouTube )
Test Data : Assignment Group = Service Desk
Caller Name = Abraham Lincoln
Caller Country = Spain ( ES)
** All changes to be made in scope = "Service Portal Surveys" **
Created copy of widget "Take Survey" and named it as Take Survey 1
Created copy of page take_survey and named it as take_survey_1
Updated widget "My Surveys"
Changes done to the widget "Take Survey" which are saved as the new widget Take Survey 1
In "Body HTML Template" add below code after
<div ng-if="data.trigger_desc" style="font-size:15px;">
{{::data.trigger_desc}}
</div>
<!-- custom Code Start -->
<div ng-if="data.trigger_table == 'incident' && data.trigger_assignmentgroup != ''" style="font-size:15px;">
{{::data.trigger_assignmentgroup}}
</div>
<div ng-if="data.trigger_table == 'incident' && data.trigger_caller != ''" style="font-size:15px;">
{{::data.trigger_caller}}
</div>
<div ng-if="data.trigger_table == 'incident' && data.trigger_country != ''" style="font-size:15px;">
{{::data.trigger_country}}
</div>
<!-- custom Code End -->
In "Server Script" add below code after sp.loadSurvey(typeId,surveyId, data);
// Custom Code
if(data.trigger_table == 'incident') {
var grInc = new GlideRecord('incident');
grInc.addQuery('sys_id', data.trigger_id);
grInc.query();
if(grInc.next()) {
data.trigger_assignmentgroup = grInc.assignment_group.name.toString();
data.trigger_caller = grInc.caller_id.name.toString();
data.trigger_country = grInc.caller_id.country.toString();
}
}
// Custom Code
Changes to page take_survey which are in the new page take_survey_1
Add the newly created widget in Row 1, Column 1
Changes to Widget "My Surveys"
Body HTML Template section 2 changes are done.
1. Comment out line <a href="?id=take_survey&instance_id={{::instance.sys_id}}" title = "Take {{::instance.evaluation_method_display}}"> and add new line
<a href="?id=take_survey_1&instance_id={{::instance.sys_id}}" title = "Take {{::instance.evaluation_method_display}}">
The updated code should look like below.
<!-- <a href="?id=take_survey&instance_id={{::instance.sys_id}}" title = "Take {{::instance.evaluation_method_display}}"> -->
<a href="?id=take_survey_1&instance_id={{::instance.sys_id}}" title = "Take {{::instance.evaluation_method_display}}">
2. Comment out line <a href="?id=take_survey&instance_id={{::instance.sys_id}}" title = "Take {{::instance.evaluation_method_display}}">
and add new line
<a href="?id=take_survey_1&instance_id={{::instance.sys_id}}" title = "Take {{::instance.evaluation_method_display}}">
The updated code should look like below.
<!-- <a href="?id=take_survey&instance_id={{::instance.sys_id}}" title = "Take {{::instance.evaluation_method_display}}"> -->
<a href="?id=take_survey_1&instance_id={{::instance.sys_id}}" title = "Take {{::instance.evaluation_method_display}}">
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2017 12:20 PM
Hi Raveena,
go to the particular widget and press CTRL on you keyboard and right click mouse.
You find the options and select the widget editor option and there you can find the code in HTML part of widget.
Hope this might be helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2017 07:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2017 07:53 AM
take_survey widget runs on asmt tables ( like asmt_assessment_instance). Depending on the survey record in the assessment instance table corresponding survey questions get displayed.
To give a short answer, its not specific to task table, hence task description and task number code wont be present.
If you can elaborate more on what you are after. I can provide more help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2017 11:58 PM
Hi Anil,
Thanks for your prompt reply. What i exactly want is to populate some more details (eg assignment group, caller,country)from table on which trigger condition of survey is defined(in my case its Incident). it is showing incident number and short description only.