Skip to content

Instantly share code, notes, and snippets.

@benglo
benglo / GenerateMarkdownTable.js
Last active December 19, 2025 00:57
Generates a horiontal or vertical markdown table for one or more records from a single table
/**
* @description Retrieves a GlideRecord for the specified table and sys_id.
* @param {string} tableName
* @param {string} recordSysId
* @returns {GlideRecord|null} Returns the GlideRecord object for the specified table and sys_id, or null if not found.
*/
function getRecord(tableName, recordSysId) {
var grRecord = new GlideRecord(tableName);
if (grRecord.get(recordSysId)) {
return grRecord;