- 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 04:02 AM
Yeah its possible, can you share code where you have customized to redirect to your custompage.
We need to add 2 parameters to URL for table and sys_id so that my suggested solution can work.
Mark my ANSWER as CORRECT / HELPFUL if it served your purpose.