- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2025 06:39 AM
how Can I show the variables from the HR case in the HR task ?
and to show them here
is it possible ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2025 09:38 PM
<g2:evaluate jelly="true"> var recordObject = new GlideRecord('sn_hr_core_case');
First, your code need to be modify slightly, from sn_hr_core_task to sn_hr_core_case.
In case, it's still not work, make sure you create the macro in Global, and allow the restricted access privilege
Brgs,
Phuong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2025 06:49 AM
this link will help you, it shows how incident variable editor can be shown on incident_task
You can follow same for HR case and HR task tables
Variable editor on child task(other than catalog task)
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2025 10:44 AM
unfortunately didn't work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2025 08:59 PM
Hi Eyal,
You seem to want to show Variables on HR Task in the portal.
You can check table ticket_configuration and see an example of sn_hr_core_case (HR Case table). The tab with type Variable Summarizer is an example showing all variables that have been submitted through the case.
Btw, I dont really think that you can use this type for HR Task table, but create a new one with Custom type, and create your own Variable Summarizer for HR Task through a widget, then attach it to the new tab configuration.
Check the Variable Summarizer widget for your reference or you can do it your own way:
https://<instance-name>.com/sp_widget.do?sys_id=3e2bcf17b7220010bcd50718ee11a956
Regards,
Phuong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2025 03:51 AM
can I show in he regualr view ?
I tried to add formatter but It didn't work.
I saw an article that says to create A ui macro and attach it to formatter. also with no luck
UI MACRO
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:requires name="scripts/js_includes_catalog.js" includes="true"/>
<g:requires name="styles/${new CatalogCssSelector().getVariableCss()}" includes="true"/>
<g:requires name="scripts/classes/ServiceCatalogForm.js"/>
<g2:evaluate var="jvar_catalog_item">
function eval_cat_item() {
var cat_item = "";
var catItemProducedGr = new GlideRecord("sc_item_produced_record");
catItemProducedGr.addQuery("record_key", current.parent);
catItemProducedGr.query();
if (catItemProducedGr.next())
cat_item = catItemProducedGr.getValue("producer");
return cat_item;
}
eval_cat_item();
</g2:evaluate>
<g2:evaluate var="jvar_cat_sets" jelly="true">
var jvar_cat_sets = "";
var gr = new GlideRecord("io_set_item");
gr.addQuery("sc_cat_item", jelly.jvar_catalog_item);
gr.query();
while (gr.next()) {
if (jvar_cat_sets.length > 0)
jvar_cat_sets += ",";
jvar_cat_sets += gr.variable_set;
}
jvar_cat_sets;
</g2:evaluate>
<div data-sn-macro-sys-id="${jvar_macro_sys_id}">
<g2:evaluate jelly="true"> var recordObject = new GlideRecord('sn_hr_core_task');
recordObject.get(current.parent);
</g2:evaluate>
<j2:set var="ref" value="recordObject" />
<j:set var="jvar_producer_target_record" value="true"/>
<g2:client_script type="catalog_item" catalogItem="$[jvar_catalog_item]"/>
<g:inline template="catalog_ui_policy.xml"/>
<g2:render_component componentName="com.glideapp.servicecatalog.DefaultQuestionEditor"/>
</div>
</j:jelly>
ui formatter