
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2017 01:41 AM
Hi
OK, I'm pretty new at this, and I am building a survey where I can write a value in a url variable with the survey link and have the survey form pick it up in a string field (preferable read-only).
For instance, a case number:
https://<link to survey>&casenumber=FF012345
I manage to view the field Default Answer in the form by removing the conditions regarding when to apply under "Show and hide default value field", but that just gives me an uneditable empty drop-down field, so I suspect I'm on the wrong track
So "all i need" is to be able to put some magic into that field and have it pick up the casenumber variable. Or another idea.
Best regards
Per
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2017 07:51 AM
you can use the sysparm_query property to set the values
https://<instance name>.service-now.com/nav_to.do?uri=incident.do?sys_id=-1%26sysparm_query=priority=1^incident_state=3
you can set this values dynamically from email notification while sending survey like below.
https://<instance name>.service-now.com/nav_to.do?uri=incident.do?sys_id=-1%26sysparm_query=assigned_project_title=${short_description}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2017 08:59 AM
I'm trying to populate a survey question with an answer however. Not sure how to pass in the data to the answer of the question. Survey's are really like accessing an incident record.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2017 05:06 PM
Use the g_form API to set the appropriate field on the form to set the value.
Regards
Hem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2017 12:18 AM
Below link explains different ways to get value from url parameter. Further you may need an onLoad client script to set values in field.
3 Ways to Populate Values in ServiceNow via the URL

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2017 04:57 AM
Today I worked my way around this, but it was srnewbie who came up with that I needed first.
I went another way: record producer.
I don't feel that the survey is versatile enough to handle what I require in this particular case unless I wanted to edit the page assessment_take2.do (which I find to be a touch much to complete my mission). It suits many other needs, but apparently not my variable-pick-up stunt. I found a way to make Legacy Survey do what I want (almost), but seeing as how legacy survey will be deprecated in near future, I have skipped it.
So, record producer. With all the fields I need, and easy access to a isolated table and application.
Added to the url for the record producer entry form: %26sysparm_query=SD1236547
String field picking up the value by having a default value: javascript:RP.getParameterValue('sysparm_query');
And the string field is made read-only with a UI policy.
Thank you all for your time and suggestions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2021 09:00 PM
Hello,
I am trying to implement your solution.
Could you tell me how you added the URL for the record producer entry form? I am mentioning your line for reference.
"Added to the url for the record producer entry form: %26sysparm_query=SD1236547"