How to Get paremeter value from public survey url
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
I have a req for adding the read only question User Name to a public survey. the value of User Name need to get from URL. how to implement it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago - last edited 2 hours ago
Hi @JackieZhang ,
You can use the below logic to get the user name and then you can add your own code if you want to set it to a particular field or anything else.
var gUrl = top.location.href; //getting the URL
//fetch the parameter from url, add the replace the param_name with your parameter name.
var uName = new URLSearchParams(gUrl).get("param_name");
*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
where is the user taking survey? portal or native?
share screenshots
what's your actual business requirement?
check this
Setting value of survey question via client script
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
