Activity Formatter Help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2016 10:53 PM
I found that in one of the threads we can have the activity formatter in the UI page as you can see below
with this script
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">
- <link rel="stylesheet" href="/styles/css_includes_ng.cssx"/>
- <nav class="navbar navbar-default section_secondary" data-id="991fec850a0006417c9edda2d4e9c487" data-type="section_head">
- <div class="container-fluid">
- <div class="navbar-header">
- <h3 class="form_header">Activity</h3>
- </div>
- <div class="navbar-right">
- <span>
- <button alt="Collapse" title="" class="icon-chevron-right btn btn-icon" tabindex="1" onclick="hideReveal('section'); return false;" data-original-title="Display / Hide"></button>
- </span>
- </div>
- </div>
- </nav>
- <g:function record_table="REQUIRED" record_id="REQUIRED" />
- <g:activity sys_id="${jvar_record_id}" fields="" table="${jvar_record_table}"
- type="changes" var="jvar_activity"/>
- <div id="section" class="h-card-wrapper activities-form col-xs-10 col-md-9 col-lg-8 form-field">
- <j:forEach items="${jvar_activity}" var="jvar_history">
- <li class="h-card h-card_md h-card_comments">
- <div class="sn-card-component sn-card-component_first sn-card-component_meta sn-card-component_meta_sibling">
- <span class="sn-card-component-createdby">${jvar_history.get(0).getValue('sys_created_by')}</span>
- </div>
- <div class="sn-card-component sn-card-component_first sn-card-component_meta">
- <span class="sn-card-component-time">
- <div class="date-calendar">${jvar_history.get(0).getValue('sys_created_on')}</div>
- </span>
- </div>
- <g:activity type="labels" records="${jvar_history}" var="jvar_field_labels"/>
- <div class="sn-card-component sn-card-component_records">
- <div class="sn-widget">
- <ul class="sn-widget-list sn-widget-list-table">
- <j:forEach items="${jvar_history}" var="jvar_h">
- <li>
- <span class="sn-widget-list-table-cell">${jvar_h.getValue('fieldname')}</span>
- <span class="sn-widget-list-table-cell">
- <span>${jvar_h.getValue('newvalue')}</span>
- </span>
- <j:if test="${jvar_h.getValue('oldvalue').trim().toString().length()!=0}">
- <span class="sn-widget-list-table-italic ng-scope">was</span>
- <span class="oldValue">${jvar_h.getValue('oldvalue')}</span>
- </j:if>
- </li>
- </j:forEach>
- </ul>
- </div>
- </div>
- <hr/>
- <div class="sn-card-component_accent-bar sn-card-component_accent-bar_dark">
- </div>
- </li>
- </j:forEach>
- </div>
- <script>
- function hideReveal(sectionName) {
- $j("#"+sectionName).toggle("hide");
- $j(".icon-chevron-right").toggleClass("hideBtn");
- }
- </script>
- <style>
- .oldValue{
- padding-left:5px !important;
- }
- .hideBtn{
- -webkit-transition: -webkit-transform 0.3s;
- -ms-transition: -ms-transform 0.3s;
- transition: transform 0.3s;
- -webkit-transform: rotate(90deg);
- -ms-transform: rotate(90deg);
- transform: rotate(90deg);
- font-size: 18px;
- }
- </style>
- </j:jelly>
IN UI Page
- <?xml version="1.0" encoding="utf-8" ?>
- <j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
- <! record_table holds table name & record_id holds sys_id of record-->
- <g:inline template="custom_activity" record_table="incident" record_id="<SYS ID OF Your Incident>" />
- </j:jelly>
This will show us the activity in a separate UI page , BUT when iam trying to change the code for the below activity formatter it is coming in my UI Page. Any Help
Any Help on this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2016 10:57 PM
HI Malu,
You may find below links helpful.
http://wiki.servicenow.com/index.php?title=Activity_Formatter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2016 11:25 PM
This thread shows the securing the activity formatter. I need to pull the values from baseline differences as you can see below when i select baseline from my UI Page.
Example: My UI Page...When i select the baseline the below Comments field should show the values from CMDB Baseline differences for the selected Basline.
Above comments field should show the below Relationship Changes in the same format.
Any help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2016 02:09 AM
Any Ideas??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2016 02:33 AM
HI Ravi,
The name of the macro should be custom_activity and please make sure that you are providing two required parameters while calling this ui macro
<g:inline template="custom_activity" record_table="incident" record_id="<SYS ID OF Your Incident>" />