Dreamfactory php script pre_process payload modify one resource field

In Dreamfactory rest API if I receive with a post request a payload like this :

{"resource": [{"Time":"2018-12-21T07:49:23","Gas":"111111","Pressure":"1111","Temperature":"11111"}]}

how can I refer only to field “Gas” to modify it into “00000” before insert it into mysql database ? This is the script that I write but I recive the below error when I do a post request:


the error is:

{"error":{"code":1000,"context":{"error":["Gas"],"resource":{"0":{"messageID":32},"Gas":{"code":500,"message":"array_merge(): Argument #1 is not an array"}}},"message":"Batch Error: Not all requested records could be created.","status_code":500}}

In all of these four files of my docker container


I have modifed:




but when I try to make a post to my rest api with fiddler with a payload like this:


I recevie always the same error:

{"error":{"code":400,"context":null,"message":"No record(s) detected in request. Please make sure record(s) are wrapped in a 'resource' tag. Example: {&quot;resource&quot;:[{&quot;record&quot;:1},{&quot;record&quot;:2}]}","status_code":400}}

Please could someone help me ?