How to create forms with pre-filled fields.

Garry Knight
Kilo Contributor

I am looking to create forms when I can easily click using the new UI interface down the left hand side, so for example when we receive a password reset the Service Desk can just click a button on the left and it will open a new incident with all the fields pre-filled with just the name outstanding.

This will save us a lot of time when raising first time fix calls that take 10 seconds to fix but a minute or so to raise the incident.

This is currently our blank incident field:

http://imgur.com/LMrAHg7

 

And if possible I would like to have a form which I can just add to the new UI so one click will open a new incident with these fields filled out (in this example for out most popular request, Password reset):

http://imgur.com/JMf7Q09

 

And if possible to also fill out the closure information like this:

http://imgur.com/kpN0lhX

 

 

Thank you in advance for any comments.

 

Garry

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Garry,



You can write the client script onload with hardcoded values on the form.


The other option is to have the template and apply it on form load.


» Advanced Templates



Please let me know if you have any questions.


Kindly mark this as answered if this answers your question.



Thanks,


Pradeep Sharma


View solution in original post

11 REPLIES 11

harikrish_v
Mega Guru

Hi Garry,



There are many ways to do this:-



1. Using templates : » Advanced Templates


2. Using default value in dictionary: http://wiki.servicenow.com/index.php?title=Creating_New_Fields#Specifying_a_Default_Value


3. Using a Display business rule


Eg: current.active=false;


          current.short_description="Test Record";


4. Using an onLoad client script


Eg: g_form.setValue('active',false);


          g_form.setValue('short_description','Test Record');



I would not recommend the 4th method as your performance will be impacted.



Thanks & Regards,


Hari


Garry Knight
Kilo Contributor

Hi All, thank you very much for the replies,



I have downloaded this update set:http://www.servicenowguru.com/downloads/?did=8


However when i click apply templates nothing happens. After further reading it seems I need to flush the cache of the instance. I am currently working on the DEV site so it will not be an issue to flush this now, then if it works schedule it to be done overnight on the live instance, however I am not 100% sure how to flush the cache propery. Any suggestions?


Thanks again in advance.


Hi,



Here you go


instancename.service-now.com/cache.do


Garry Knight
Kilo Contributor

Thanks have got it working. Only issue I have now is when I have the subcategory chosen on the template it removes the short description template.. If subcategory is not selected the short description shows... no idea how that works.


Hi,



Please check the short description field in the template you created


Also check if there is any client script on subcategory field on your form.



Thanks,


Pradeep Sharma