- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2020 01:12 AM
Hi all,
g_form.getParameter("sysparm_item_guid"); is not working on service portal AND
g_form.getUniqueValue() is also not working
is there any alternate way.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2020 01:58 AM
in newyork its available , without writing a single code.
Give a try.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2020 01:14 AM
g_form.getUniqueValue() should work.
make sure UI type set as ALL. can you add screenshot.
also try to add alert(g_form.getUniqueValue()), let me know what are you getting ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2020 01:22 AM
Hi there,
Could you explain your requirement? Is this for example for new records on the Service Portal, for example when submitting a Catalog Item. Or is this for when viewing existing records? And is it the sys_id of the new record to create, or the sys_id of the Catalog Item?
g_form.getParameter("sysparm_item_guid"); is indeed not available.
For new... g_form.getUniqueValue() indeed doesn't work. Or it does give you a value, though maybe not what you expect? I mean... what is the value you expect?
sys_id of that new record? Or sys_id of that Catalog Item? You will only get your hands on the sys_id of the Catalog Item, not of the new record.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2020 01:51 AM
My requirement is to make attachment mandatory on catalog item in service portal
when i use g_form.getParameter(sysparm_item_guid) its giving the sys_id of item which matches with table_sys_id field on sys_attachment table.(on console)
getUniquevalue() is working on portal and console as well,but value returned is giving item sys_id which doesnot matches with table_sys_id on sys_attachment table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2020 02:00 AM
If it's only about mandatory, read this article I wrote a while back:
Service Portal Catalog Items: Hide Attachment / Mandatory Attachment [Madrid]
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field