- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2018 04:28 AM
Hi all,
I wanted to know how to make use of gel in servicenow.
Some of the lines I have come across:
1.
com = gel("activity-stream-comments-textarea"); if (com) com.focus(); return;
2. gel('sysparm_item_guid').value
so I wanted to know what are those values "activity-stream-comments-textarea" and ''sysparm_item_guid'"
how and where those values can be found and used.
any other simple example to make use of gel would be greatly helpful
thanks in advance 🙂
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2018 04:47 AM
Hi Shanks,
So avoid using if you can but if you absolutely must, then see these useful articles for full description of use/issue:
https://snprotips.com/blog/2017/7/21/how-to-enable-dom-manipulation-in-the-servicenow-service-portal
http://www.snc-blog.com/2011/03/03/altering-the-dom-document-object-model-with-javascript/
Regards,
Paul
Regards
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2018 05:11 AM
One last question on this topic:
I see this line written :
var sys=document.getElementById('sysparm_attachment_cart_id').value;
How can I know what is that field "sysparm_attachment_cart_id" (reverse way 🙂 )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2018 08:41 PM
@paul.curwen did you get a chance to look at my question 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2018 08:59 PM
Hi Shanks,
What is the use case you are trying to pull out the reverse way here ?
In short it is not feasible because uneven element architecture and because of the fact, it may not be even a form element(hidden field like guid).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2021 10:55 AM
Hi Paul
The first link you posted no longer works (no surprise, it's been years).
However, The ServiceNow documentation uses gel in their dot walking example in their own documentation.
https://docs.servicenow.com/bundle/rome-platform-user-interface/page/use/navigation/reference/dot-walking-examples.html
Been there since New York.
Also, I just used it in a Catalog Client script. I had to add the Isolate script field to the form and uncheck it first, to use it.
Thanks for your insights,
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2018 05:08 AM
Thanks Paul, that is what I was looking for until now. 🙂