We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 883c547 commit 2dacbe4Copy full SHA for 2dacbe4
Specialized Areas/Fix scripts/Create Table JSON/script.js
@@ -0,0 +1,12 @@
1
+getJson('incident', 'rfc,caller_id'); // pass table name and field names comma separated.
2
+function getJson(tableName, fields) {
3
+ var jsonObj = {};
4
+ var eQry = gs.nil(fields) ? 'name=' + tableName : 'name=' + tableName + '^elementIN' + fields; // generate JSON of enitre table if no fields are specified.
5
+ var dict = new GlideRecord('sys_dictionary');
6
+ dict.addEncodedQuery(eQry);
7
+ dict.query();
8
+ while (dict.next()) {
9
+ jsonObj[dict.element] = '';
10
+ }
11
+ gs.print(JSON.stringify(jsonObj));
12
+}
0 commit comments