We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c264f76 commit 74e184aCopy full SHA for 74e184a
1 file changed
Server-Side Components/Transform Map Scripts/Check if the Import file is valid/script.js
@@ -0,0 +1,21 @@
1
+/*
2
+When : onStart
3
+Active : True
4
+*/
5
+
6
+(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
7
8
+ var table = import_set.table_name;
9
+ var run = new GlideAggregate(table);
10
+ run.addQuery("sys_import_set", import_set.sys_id);
11
+ run.addAggregate('COUNT');
12
+ run.query();
13
+ while (run.next()) {
14
+ var count = parseInt(run.getAggregate('COUNT'));
15
+ if (count < 1) { // Check the row count of the latest import job. If it's 0, then abort the transformation and raise a ticket (Optional)
16
+ ignore = true;
17
+ gs.error("File is empty. Hence aborting the transformation");
18
+ }
19
20
21
+})(source, map, log, target);
0 commit comments