Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 1405084

Browse files
committed
Merge branch 'control_errors'
2 parents fbb7525 + 7a19051 commit 1405084

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

docs/examples/footerFormulas/obtainAverage.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/**
22
* Obtains the average of the values in the column
3+
*
4+
* Formula: ${db.js.obtainAverage(colValues)}
35
* @param {*} obtainAverage
46
* @returns
57
*/
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* Determine if a section exists in a note by checking the headings.
3+
*
4+
* Formula: ${db.js.isSectionExist(row,"my section")}
5+
* @param {*} row
6+
* @param {*} sectionString
7+
* @returns
8+
*/
9+
function isSectionExist(row,sectionString){
10+
const headings = app.metadataCache.getFileCache(row.__note__.getFile()).headings;
11+
return headings.some(h => h.heading===sectionString);
12+
}
13+
14+
module.exports = isSectionExist

0 commit comments

Comments
 (0)