Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Filling document_id type field in modal

Not applicable

Hello friends, 

I went through out all advices but nothing worked for me.
I need simply create modal window with prefilled document_id field "feature".

My code look like this, but not working. If you have any help, it is very appreciated.
Thank you.

Radek7_0-1732116984199.png

 

2 REPLIES 2

jcmings
ServiceNow Employee

Are you trying to set the field values? What's with using sysparm_query? I would take a look at the GlideModal documentation.

Not applicable

Hello jc21, yes I am trying to set field value on "feature" field that is document_id type. 
Setting by this: modal.setPreference('name', 'value'); is not working so I had to use this approach:

modal.setPreference('sysparm_query', 'comment=hello'); 
But for field "feature" this is not working as well...