关于 esg-document-intelligence
面向 ServiceNow 的技能,可从文档和记录中提取 ESG 数据,并整理用于报告与分析。涵盖框架披露、排放范围、绩效趋势及追溯到源文件的数据记录。
主要功能
- 01提取能源、排放和废弃物数据
- 02将指标映射到 ESG 框架
- 03跟踪范围 1、2 和 3 排放
- 04检查披露完整性和数据缺口
- 05准备仪表板趋势数据
适用场景
- 01编制年度可持续发展报告
- 02将公用事业账单转为指标数据
- 03在 ESG 披露前识别缺口
- 04审计时追溯报告指标来源
MCP 相关
使用 ServiceNow MCP 工具查询 ESG 记录、搜索文档、创建数据点、更新指标并执行计算。
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ happy-technologies-llc/ happy-platform-skills --skill esg-document-intelligence安装后在 Claude Code 中输入/esg-document-intelligence确认已加载。
详细介绍
ESG 文档智能
概述
此技能可从文档和 ServiceNow 记录中提取并分析环境、社会和治理(ESG)数据。涵盖以下内容:
- 从公用事业账单和报告中提取能源消耗、碳排放和废弃物数据
- 将提取的指标映射到 ESG 框架要求(GRI、SASB、TCFD、CDP、CSRD)
- 跟踪设施和时间段内的 Scope 1、2 和 3 温室气体排放
- 根据法规和自愿报告框架分析披露完整性
- 生成包含趋势分析和基准对比的 ESG 绩效仪表板
- 识别可能影响披露准确性或合规性的数据缺口
适用场景:
- 编制年度 ESG/可持续发展报告期间
- 处理公用事业账单以更新环境指标时
- 提交 CDP、GRI 或 CSRD 披露材料前
- 管理层需要了解环境绩效概况时
- ESG 审计要求追溯指标至源文档时
前提条件
- 角色:
sn_esg.admin、sn_esg.manager、sn_esg.data_entry或admin - 插件:
com.sn_esg(ESG 管理) - 访问权限: 对 sn_esg_metric、sn_esg_disclosure、sn_esg_framework 表具有读写权限
- 知识: 了解 ESG 框架(GRI Standards、SASB、TCFD)、温室气体核算的 GHG Protocol,以及所在组织的实质性评估
主要 ESG 表
| 表 | 用途 | 关键字段 |
|---|---|---|
sn_esg_metric | ESG 绩效指标 | number, metric_name, category, value, unit, period, location, scope, framework, data_source |
sn_esg_disclosure | 框架披露答复 | number, framework, disclosure_id, response, status, evidence, reporting_period, reviewer |
sn_esg_framework | ESG 框架定义 | name, version, category, standard_body, active, disclosure_count |
sn_esg_data_point | 来源中的原始数据点 | metric, value, date, source_document, location, verified, notes |
cmn_location | 设施/位置记录 | name, city, state, country, building, latitude, longitude |
操作步骤
步骤 1:查询现有 ESG 指标
检索当前 ESG 指标,了解基线情况。
使用 MCP(Claude Code/Desktop):
Tool: SN-Query-Table
Parameters:
table_name: sn_esg_metric
query: active=true^ORDERBYcategory
fields: sys_id,number,metric_name,category,value,unit,period,location,scope,framework,data_source,last_updated
limit: 100
使用 REST API:
GET /api/now/table/sn_esg_metric?sysparm_query=active=true^ORDERBYcategory&sysparm_fields=sys_id,number,metric_name,category,value,unit,period,location,scope,framework,data_source,last_updated&sysparm_limit=100&sysparm_display_value=true
步骤 2:从公用事业账单中提取数据
处理公用事业账单数据,提取环境指标。
检索账单附件:
Tool: SN-Query-Table
Parameters:
table_name: sys_attachment
query: table_nameLIKEesg^ORtable_nameLIKEutility^ORtable_nameLIKEinvoice^content_typeLIKEpdf
fields: sys_id,file_name,table_name,table_sys_id,content_type,size_bytes,sys_created_on
limit: 50
order_by_desc: sys_created_on
解析并记录提取的能源数据:
Tool: SN-Create-Record
Parameters:
table_name: sn_esg_data_point
fields:
metric: [energy_metric_sys_id]
value: 45230
date: 2026-02-28
source_document: "February 2026 Electric Utility Invoice - Building A"
location: [location_sys_id]
verified: false
notes: "Extracted from utility invoice. 45,230 kWh electricity consumption."
步骤 3:计算碳排放
根据源数据计算 Scope 1、2 和 3 排放:
Tool: SN-Execute-Background-Script
Parameters:
script: |
// EPA emission factors (2025 US average)
var EMISSION_FACTORS = {
electricity_kwh: 0.000386, // metric tons CO2e per kWh (US avg grid)
natural_gas_therm: 0.005302, // metric tons CO2e per therm
diesel_gallon: 0.010180, // metric tons CO2e per gallon
gasoline_gallon: 0.008887, // metric tons CO2e per gallon
propane_gallon: 0.005740 // metric tons CO2e per gallon
};
var period = '2026-Q1';
var emissions = {
period: period,
scope1: { total: 0, sources: {} },
scope2: { total: 0, sources: {} },
scope3: { total: 0, sources: {} },
total_co2e: 0,
unit: 'metric tons CO2e'
};
// Query energy data points for the period
var dp = new GlideRecord('sn_esg_data_point');
dp.addQuery('date', '>=', '2026-01-01');
dp.addQuery('date', '<=', '2026-03-31');
dp.query();
while (dp.next()) {
var metricRec = new GlideRecord('sn_esg_metric');
metricRec.get(dp.metric.toString());
var metricName = metricRec.metric_name.toString().toLowerCase();
var value = parseFloat(dp.value.toString()) || 0;
var scope = metricRec.scope.toString();
var co2e = 0;
if (metricName.match(/electricity/)) co2e = value * EMISSION_FACTORS.electricity_kwh;
else if (metricName.match(/natural gas/)) co2e = value * EMISSION_FACTORS.natural_gas_therm;
else if (metricName.match(/diesel/)) co2e = value * EMISSION_FACTORS.diesel_gallon;
else if (metricName.match(/gasoline/)) co2e = value * EMISSION_FACTORS.gasoline_gallon;
if (scope == '1') {
emissions.scope1.total += co2e;
emissions.scope1.sources[metricName] = (emissions.scope1.sources[metricName] || 0) + co2e;
} else if (scope == '2') {
emissions.scope2.total += co2e;
emissions.scope2.sources[metricName] = (emissions.scope2.sources[metricName] || 0) + co2e;
} else {
emissions.scope3.total += co2e;
emissions.scope3.sources[metricName] = (emissions.scope3.sources[metricName] || 0) + co2e;
}
}
emissions.scope1.total = Math.round(emissions.scope1.total * 100) / 100;
emissions.scope2.total = Math.round(emissions.scope2.total * 100) / 100;
emissions.scope3.total = Math.round(emissions.scope3.total * 100) / 100;
emissions.total_co2e = emissions.scope1.total + emissions.scope2.total + emissions.scope3.total;
gs.info('EMISSIONS CALCULATION:\n' + JSON.stringify(emissions, null, 2));
description: "ESG: Calculate GHG emissions by scope from energy data points"
步骤 4:评估披露完整性
检查各框架披露项是否已完成,或是否存在缺口:
Tool: SN-Execute-Background-Script
Parameters:
script: |
var frameworks = ['GRI', 'SASB', 'TCFD', 'CDP'];
var completeness = { reporting_period: '2025', frameworks: {} };
for (var f = 0; f < frameworks.length; f++) {
var fw = frameworks[f];
completeness.frameworks[fw] = { total: 0, complete: 0, in_progress: 0, not_started: 0, gaps: [] };
var disc = new GlideRecord('sn_esg_disclosure');
disc.addQuery('framework.name', fw);
disc.addQuery('reporting_period', '2025');
disc.query();
while (disc.next()) {
completeness.frameworks[fw].total++;
var status = disc.status.toString().toLowerCase();
if (status == 'complete' || status == 'submitted') {
completeness.frameworks[fw].complete++;
} else if (status == 'in_progress' || status == 'draft') {
completeness.frameworks[fw].in_progress++;
} else {
completeness.frameworks[fw].not_started++;
completeness.frameworks[fw].gaps.push({
disclosure_id: disc.disclosure_id.toString(),
description: disc.short_description.toString()
});
}
}
}
gs.info('DISCLOSURE COMPLETENESS:\n' + JSON.stringify(completeness, null, 2));
description: "ESG: Assess disclosure completeness across ESG frameworks"
步骤 5:生成 ESG 绩效仪表板数据
汇总趋势数据,用于高管报告:
Tool: SN-Execute-Background-Script
Parameters:
script: |
var dashboard = {
generated_date: new GlideDateTime().toString(),
environmental: {
total_emissions_ytd: 0,
emissions_vs_target: '',
energy_consumption_kwh: 0,
renewable_percentage: 0,
waste_diverted_percentage: 0,
water_usage_gallons: 0
},
yoy_comparison: {},
by_location: {},
data_quality: { verified: 0, unverified: 0, missing: 0 }
};
// Aggregate YTD metrics by category
var categories = {
'emissions': 'total_emissions_ytd',
'energy': 'energy_consumption_kwh',
'water': 'water_usage_gallons'
};
var metric = new GlideRecord('sn_esg_metric');
metric.addQuery('category', 'environmental');
metric.addQuery('active', true);
metric.query();
while (metric.next()) {
var loc = metric.location.getDisplayValue() || 'Unknown';
if (!dashboard.by_location[loc]) dashboard.by_location[loc] = { emissions: 0, energy: 0 };
var val = parseFloat(metric.value.toString()) || 0;
var mName = metric.metric_name.toString().toLowerCase();
if (mName.match(/emission|co2|ghg/)) {
dashboard.environmental.total_emissions_ytd += val;
dashboard.by_location[loc].emissions += val;
}
if (mName.match(/energy|electricity|kwh/)) {
dashboard.environmental.energy_consumption_kwh += val;
dashboard.by_location[loc].energy += val;
}
}
// Data quality check
var dp = new GlideAggregate('sn_esg_data_point');
dp.addQuery('verified', true);
dp.addAggregate('COUNT');
dp.query();
if (dp.next()) dashboard.data_quality.verified = parseInt(dp.getAggregate('COUNT'));
var dpUnverified = new GlideAggregate('sn_esg_data_point');
dpUnverified.addQuery('verified', false);
dpUnverified.addAggregate('COUNT');
dpUnverified.query();
if (dpUnverified.next()) dashboard.data_quality.unverified = parseInt(dpUnverified.getAggregate('COUNT'));
gs.info('ESG DASHBOARD DATA:\n' + JSON.stringify(dashboard, null, 2));
description: "ESG: Generate environmental performance dashboard data"
步骤 6:根据提取的数据更新指标
将新提取的指标记录回 ESG 模块:
Tool: SN-Update-Record
Parameters:
table_name: sn_esg_metric
sys_id: [metric_sys_id]
data:
value: 1245.6
last_updated: 2026-03-19
data_source: "Utility invoices Q1 2026 - Buildings A, B, C"
work_notes: "Updated from Q1 utility invoice extraction. Previous value: 1180.2. Increase of 5.5% due to expanded Building C operations."
工具使用
| 操作 | MCP 工具 | REST 端点 |
|---|---|---|
| 查询指标 | SN-Query-Table | GET /api/now/table/sn_esg_metric |
| 查询披露项 | SN-Query-Table | GET /api/now/table/sn_esg_disclosure |
| 查询框架 | SN-Query-Table | GET /api/now/table/sn_esg_framework |
| 创建数据点 | SN-Create-Record | POST /api/now/table/sn_esg_data_point |
| 更新指标 | SN-Update-Record | PATCH /api/now/table/sn_esg_metric |
| 排放计算 | SN-Execute-Background-Script | POST /api/now/table/sys_trigger |
| 搜索文档 | SN-Natural-Language-Search | N/A |
最佳实践
- 来源可追溯性: 始终将数据点链接到其来源文档(发票、报告),以便留存审计线索
- 排放因子时效性: 每年更新排放因子;如果可以,优先使用区域电网因子,而非全国平均值
- 核验工作流: 将所有提取的数据标记为未经核验,直至可持续发展团队完成审核
- 范围准确性: 按照 GHG Protocol 谨慎划分排放范围;对于 Scope 2,区分基于市场和基于位置的核算方法
- 单位一致性: 汇总前统一各设施的单位(kWh、吨 CO2e、加仑)
- 缺口记录: 明确记录数据缺口;对估算值进行标记,并附上方法说明
- 框架对齐: 将每项指标映射到其对应的 GRI Standard、SASB 主题或 TCFD 建议
- 聚焦重要性: 优先处理与组织重要性评估结果相符的指标
故障排除
未找到 ESG 指标表
症状: 查询 sn_esg_metric 时返回表未找到错误
原因: ESG Management 插件可能未启用,或者表名因版本不同而有所差异
解决方案: 使用 nameLIKEesg 查询 sys_db_object,以查找可用的 ESG 表。检查 com.sn_esg 插件是否处于启用状态。
排放因子计算结果不正确
症状: 计算出的排放量明显过高或过低 原因: 输入数据与排放因子的单位不匹配(例如,MWh 与 kWh、therm 与 MMBtu) 解决方案: 核实指标记录和数据点记录中的单位字段。应用排放因子前先转换单位。
缺少披露框架记录
症状: 未找到 GRI、SASB 或 TCFD 的披露记录 原因: 必须通过 ESG 模块设置加载框架披露模板;这些模板不会自动填充 解决方案: 在 ServiceNow UI 中前往 ESG Management > Frameworks,并导入相关框架模板。
示例
示例 1:月度公用事业账单处理
场景: 可持续发展分析师处理每月的电费和燃气账单
Tool: SN-Create-Record
Parameters:
table_name: sn_esg_data_point
fields:
metric: [electricity_metric_sys_id]
value: 125400
date: 2026-02-28
source_document: "ConEd Invoice #INV-2026-0228 - HQ Building"
location: [hq_location_sys_id]
verified: false
notes: "125,400 kWh. Rate: $0.14/kWh. Total: $17,556. Demand charge: 450 kW peak."
结果: 已记录数据点,并自动计算出 48.4 吨 CO2e 的 Scope 2 排放量。
示例 2:准备年度 CDP 披露
场景: ESG 经理需要找出 CDP 气候变化问卷中的缺口
Tool: SN-Query-Table
Parameters:
table_name: sn_esg_disclosure
query: framework.nameLIKECDP^reporting_period=2025^status!=complete
fields: disclosure_id,short_description,status,response,evidence
limit: 100
结果: 82 项 CDP 披露中有 14 项未完成。关键缺口:Scope 3 Category 6(商务旅行)、Scope 3 Category 7(员工通勤)、气候相关目标验证。
相关技能
grc/issue-summarization- 针对 ESG 合规发现进行 GRC 问题分析grc/risk-assessment-summarization- 气候风险评估分析grc/regulatory-alert-analysis- ESG 监管变更跟踪document/document-extraction- 从公用事业账单和报告中提取数据reporting/executive-dashboard- 构建 ESG 高管仪表板