Quantcast
Channel: DreamFactory Forum - Latest posts
Viewing all articles
Browse latest Browse all 5027

Unable to find whether the script is being executed or not?

$
0
0

HI,

I have created a post process script in v8js. But the script is not being executed.

Here is the script I have written:

print("Starting FirstTable post process");
var_dump(event.response); // outputs to file in storage/log of dreamfactory install directory
var lodash = require("lodash.min.js");
var options = {
"CURLOPT_HTTPHEADER": ["Content-type: application/json", "kf-api-key: 1234567"]
};
print("Starting payload process");
if (event.request.payload.resource) {

lodash._.each (event.request.payload.resource, function( record ) {
print("saving user to klipfolio");
result = platform.api.post("https://app.klipfolio.com/api/1/users", {"first_name":record.Column1,"last_name":record.Column1,"email":record.email}, options);

});

print("Ending payload process");
}

I have added print message at every step.But nothing is being displayed in the dreamfactory log. But I see following log messages:

[2016-03-15 17:37:02] local.DEBUG: Resource event: srdb._table.{table_name}.post.pre_process  [2016-03-15 17:37:02] local.DEBUG: Resource event: srdb._table.FirstTable.post.pre_process  [2016-03-15 17:37:02] local.DEBUG: Resource event: srdb._table.FirstTable.post.post_process  [2016-03-15 17:37:02] local.DEBUG: Resource event: srdb._table.{table_name}.post.post_process

I am clueless on where the mistake is. Please help.

Best Regards
Krishna G


Viewing all articles
Browse latest Browse all 5027

Trending Articles