This is a bug in jsforce
. You can work around it by using Analytics API and specifying the latest API version (v52.0 as of this writing):
var jsforce = require("jsforce");
var conn = new jsforce.Connection({
loginUrl: "https://login.salesforce.com",
version: "52.0",
});
conn.login("...", "...", function (err, userInfo) {
if (err) {
return console.error(err);
}
var reportId = "00O...";
conn.analytics.report(reportId).describe(function (err, meta) {
if (err) {
return console.error(err);
}
console.log(meta.reportMetadata);
console.log(meta.reportTypeMetadata);
console.log(meta.reportExtendedMetadata);
});
});
Testing this with a report that contains a row-level formula, the response metadata shows the formula:
customDetailFormula: {
CDF1: {
dataType: 'string',
decimalPlaces: ...,
description: null,
formula: '...',
formulaType: 'text',
label: '...'
}
},
The API version matters. As of this writing jsforce
uses v42.0 by default if you don't explicitly specify a version when creating a Connection object. This is too early for Analytics API vis-a-vis customDetailFormula
: the latter doesn't show up in the response with v42.
Trying v52.0 with jsforce + Metadata API via metadata.readSync
and valid report name, nothing is returned. The same test case works when calling Metadata API directly via SOAP and v52. Thus, this is a jsforce
bug.