- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2019 09:04 AM
Hello All,
On survey form, we have a question which is a reference to the incident table. where we have to display incidents only requested for and opened by is logged in user.
It is mentioned on ServiceNow docs page that for reference type ref qualifiers doesn't work.
https://docs.servicenow.com/bundle/newyork-servicenow-platform/page/administer/survey-administration/concept/c_SurveyDesignerElements_1.html
Is there any other way of doing it?
Appreciate your response.
Archie
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2019 07:44 AM
Hi Archie,
you can apply query business rule on incident table and restrict it to run only when somebody opens incident table from the survey page and not from the native UI
business rule: before query
table: incident
script:
var url = gs.action.getGlideURI().getMap().get('sysparm_target');
if(url.indexOf('ASMTQUESTION') >= 0){
var query = 'opened_by=' + gs.getUserID()+ '^requested_for=' + gs.getUserID();
current.addEncodedQuery(query);
}
What the script does is checks whether the url contains ASMTQUESTION; if yes then it means it is survey page; then only run the query business rule
the above business rule won't run for native UI
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2020 12:51 AM
Hello Ankur,
Is there also a way to do this in the Survey Portal Widget?
In the Widget the BR dont work.
var url = gs.action.getGlideURI().getMap().get('sysparm_target');
is always 'null'
Regards
Alexander
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2020 01:35 AM
Hi,
Yes I have come across this situation wherein the getGlideURI() doesn't work well in portal.
What error it shows in system logs
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader