- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2018 02:38 AM
OK, so I am pretty new to the Service Portal as many are I suppose. I would like to get some help with something that I believed at first to be a very easy thing to accomplish. It could as well be very easy but my head hurts from thinking about a solution to this. Anyway this is what I am trying to accomplish
1. Create a walk up portal so that users can all submit incidents and requests from a tablet
2. I was able to create the portal and design it to look and work as required
3. I have just 2 options in the portal, Create an incident and Make a request. One is record producer and the other a request creator
4. I have the "Request for" variable in both forms, reference to the sys_user table
5. After Submit is clicked the user is being taken to another page, the same for both record and request producers, where they are thanked for the submission of the ticket. This page is using a custom made widget, simple one just displaying a thank you message.
6. I would like to display in this page the value selected in the "Request for" variable but found it to be a very difficult thing to do.
Seems like I need to use the below Client Script in the copy of the SC Catalog Item widget. The below works fine in bringing the sys_id of the person selected in the "Request for" field. Now as far as I understand I need to pass this in the Server script in the same copy of the SC Catalog Item widget. This I wasn't able to do so far. Maybe someone could point me in the right direction.
After all of this is done I also have to change the custom widget I have created for the last page (point 5 above) to listen to the copy of the SC Catalog Item widget and broadcast the value to this widget as well. This seems to be a bit much to just get a value form a variable.
Is there some other way, an easier way to just get the value from the "Request for" field and presented in the custom page referred to at point 5. I would just like to have in that page something like "<Request for name>, thank you for submitting the ticket!".
Client controller:
$rootScope.$on("field.change", function(evt, parms) {
if (parms.field.variable_name == 'name') {
c.data.name = parms.newValue;
}
c.data.get_requester = c.data.name;
});
Many thanks for any help with this,
Bogdan
Solved! Go to Solution.
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2018 02:50 AM
Hi,
Seems like you are trying complicated way to achieve it.
Please follow below steps.
1)on your custom page which is displayed after submiting request, what does URL look like? Most likey it will have table=sc_request&sys_id=caa6c75ddb2313003be22fb7489619b5
2)So in your custom widget you can read these values and fetch GlideRecord of that record and then fetch the "Requested for" variable or "Created By" field value as your message is meant for created by rather that "Requested for".
in you custom widget's server script write below lines
var request_id = $sp.getParameter('sys_id');
var table = $sp.getParameter('table');
var gr = new GlideRecord(table);
gr.get(request_id);
data.name = gr.getDisplayValue('sys_created_by');
HTML
<div>
{{data.name}} , Thanks for submiting.
</div>
Let me know if you need any help.
Mark my ANSWER as CORRECT / HELPFUL if it served your purpose.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2018 02:50 AM
Hi,
Seems like you are trying complicated way to achieve it.
Please follow below steps.
1)on your custom page which is displayed after submiting request, what does URL look like? Most likey it will have table=sc_request&sys_id=caa6c75ddb2313003be22fb7489619b5
2)So in your custom widget you can read these values and fetch GlideRecord of that record and then fetch the "Requested for" variable or "Created By" field value as your message is meant for created by rather that "Requested for".
in you custom widget's server script write below lines
var request_id = $sp.getParameter('sys_id');
var table = $sp.getParameter('table');
var gr = new GlideRecord(table);
gr.get(request_id);
data.name = gr.getDisplayValue('sys_created_by');
HTML
<div>
{{data.name}} , Thanks for submiting.
</div>
Let me know if you need any help.
Mark my ANSWER as CORRECT / HELPFUL if it served your purpose.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2018 03:01 AM
OK, so I eventually changed the last page where the user is being thanked for Submitting and now the URL is table=....&sys_id=....
The above works just fine for ('sys_created_by') but how can I make it so it looks in the variables instead? In order to get the values from the "Enter your name" variable form the form?
Thanks again,
Bogdan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2018 04:46 AM
Hi Bhagyashree,
Thanks for point me in the right direction. I was able to use what you suggested and I was able to get what I wanted in the end.
For anyone out there having the same question/issue please reach out and I will do my best to help out.
Thanks again,
Bogdan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2018 03:06 AM
Thanks for the quick reply,
After submission the URL of the page is "walkup?id=walkup_submission&sysparm_domain_restore=false&sysparm_stack=no" This is a custom page. The requester needs to see only the "<Request for name>, thank you for submitting the ticket!" message, nothing else.
If the page was redirected to the sc_request page then i think your suggestion would have worked just great. Is there a way to still use the method above even if the redirect is to "walkup?id=walkup_submission&sysparm_domain_restore=false&sysparm_stack=no"?I mean it should be the case as in the background the req-ritm-task are still being created but the requester doesn't see that.
Thanks,
Bogdan