Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Christopher_Mal
ServiceNow Employee
ServiceNow Employee

Have you ever wondered what happens with the system when you hit a URL similar to this in the browser?
https://demo.service-now.com/incident.do?CSV
This is a processor doing this work for you.

I co-presented with David Loo during our Knowledge12 conference this year on Advanced Integrations. Towards the end of our lab he brought up the concept of processors in the SNC platform. I had no idea what they were or how to use them so I have started a quest to figure them out. I am still only beginning this quest, but I will be updating this blog as I find out more and more. I thought it would be good to pass on what I do know. David said this will be a key area to understand for platform developers and that more documentation will come.

If you go to the System Definitions -> Processors module you will see that the SNC system comes standard with a handful of prebuilt processors. You do have the ability to write more. I am going to share the example we demonstrated at Knowledge12 and hopefully things will make sense.

Steps:
1. Go to the Processors module and click New
2. Fill in these fields with values indicated:
- Name:Hello
- Active:(checked)
- Type:Script
- Path:Hello
3. In the script section type the following:



var name = g_request.getParameter("name");
g_processor.writeOutput("text/plain", "Hello " + name);

4. Open a browser and in the URL address field type the following:
https://your_instance/Hello.do?name=world

Results:
You will get back a plain text message in your browser of Hello World.

So what is the big deal? Here is the big deal, you have full access to the functionality of the platform and the data through these processors. You could write a processor that streams the results of a database query, or runs a specific automation. When you do https://instance/table.do?WSDL you are calling the work of a processor. That is true for ?PDF, ?RSS, ?JSON, ?CSV.

You could call your processor URL from your own code and FTP the output to another location.

I hope to provide more to this blog the more I figure out. Happy coding. Cheers.

15 Comments