From 92b184bc2240bb02afd93d2cadc63930e170cf27 Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Fri, 10 Oct 2025 18:26:21 +0530 Subject: [PATCH 1/4] Create test.js --- Specialized Areas/Fix scripts/test.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 Specialized Areas/Fix scripts/test.js diff --git a/Specialized Areas/Fix scripts/test.js b/Specialized Areas/Fix scripts/test.js new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/Specialized Areas/Fix scripts/test.js @@ -0,0 +1 @@ + From f0add90e292d47924110b758d3e0a1c123b4abb5 Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Fri, 10 Oct 2025 18:27:02 +0530 Subject: [PATCH 2/4] Delete Specialized Areas/Fix scripts/test.js --- Specialized Areas/Fix scripts/test.js | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Specialized Areas/Fix scripts/test.js diff --git a/Specialized Areas/Fix scripts/test.js b/Specialized Areas/Fix scripts/test.js deleted file mode 100644 index 8b13789179..0000000000 --- a/Specialized Areas/Fix scripts/test.js +++ /dev/null @@ -1 +0,0 @@ - From 4b58955fa19832589435b339653c2aa5de91b2bb Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Wed, 15 Oct 2025 21:06:54 +0530 Subject: [PATCH 3/4] Create script.js --- .../Beautify JSON Data in String Fields/script.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Specialized Areas/Beautify JSON Data in String Fields/script.js diff --git a/Specialized Areas/Beautify JSON Data in String Fields/script.js b/Specialized Areas/Beautify JSON Data in String Fields/script.js new file mode 100644 index 0000000000..2c8fa95971 --- /dev/null +++ b/Specialized Areas/Beautify JSON Data in String Fields/script.js @@ -0,0 +1,9 @@ +/* +This script will format the JSON data in string fields on forms. +There is on OOB attribute "json_view" which can be added to field but it always reqires an extra click and has loading time issues. +*/ +var chReq = new GlideRecord('change_request'); // Glide table. +chReqch.get('c83c5e5347c12200e0ef563dbb9a7190'); // sys_id of record, can be replaced with encoded query for multiple records. + +chReq.u_json_field = JSON.stringify(JSON.parse(chReq.u_json_field), null, "\t"); +chReq.update(); From ce42607711f29cd2b31eade2cf4c04f768d92272 Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Wed, 15 Oct 2025 21:08:57 +0530 Subject: [PATCH 4/4] Create README.md --- .../Beautify JSON Data in String Fields/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Specialized Areas/Beautify JSON Data in String Fields/README.md diff --git a/Specialized Areas/Beautify JSON Data in String Fields/README.md b/Specialized Areas/Beautify JSON Data in String Fields/README.md new file mode 100644 index 0000000000..885552829e --- /dev/null +++ b/Specialized Areas/Beautify JSON Data in String Fields/README.md @@ -0,0 +1,8 @@ +**Details** +1. This script will format the JSON data in string fields on forms. +2. There is on OOB attribute "json_view" which can be added to field but it always reqires an extra click and has loading time issues. + +**How to use** +1. Run this script as Fix Script. +2. Replace the table name and encoded query as per your requirement. +3. Replace the field to be formatted as per the table selected.