We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c3be79 commit 08d3029Copy full SHA for 08d3029
test-complete/data/dmsdk/transform/write-transform.sjs
@@ -0,0 +1,20 @@
1
+function writeTimestamp(context, params, content)
2
+{
3
+ if (context.inputType.search('json') >= 0) {
4
+ const result = content.toObject();
5
+ result.writeTimestamp = fn.currentDateTime();
6
+
7
+ // Add a property for each caller-supplied request param
8
+ for (const pname in params) {
9
+ if (params.hasOwnProperty(pname)) {
10
+ result[pname] = params[pname];
11
+ }
12
13
+ return result;
14
+ } else {
15
+ // Pass thru for non-JSON documents
16
+ return content;
17
18
+};
19
20
+exports.transform = writeTimestamp;
0 commit comments