How to delete a record in Zoho Creator from a Deluge function in CRM

How to delete a record in Zoho Creator from a Deluge function in CRM

Hello,

I've got a Deluge function in the Zoho CRM triggered by workflow with this code, trying to delete a record containing a product code.

  1. creatorApiUpdateUrl = "https://www.zohoapis.eu/creator/v2.1/data/xxxxxxxx/yyyyyyyy/report/All_Courses";
  2. payload.put("criteria","(Course_Code==\"" + coursecode + "\")");
  3. info "(Course_Code == '" + coursecode + "')";
  4. info payload;
  5. // Delete
  6. deletePayload = Map();
  7. deletePayload.put("criteria","(Course_Code==\"" + coursecode + "\")");
  8. //deletePayload.put("skip_workflow", ["form_workflow"]);
  9. //deletePayload.put("result", {"message": true, "tasks": true});
  10. info "-------- DELETE PAYLOAD --------";
  11. info deletePayload;
  12. creatorApiDeleteResp = invokeurl
  13. [
  14. url : creatorApiUpdateUrl
  15. type : DELETE
  16. parameters : deletePayload
  17. connection : "creatorfunctions"
  18. ];
  19. info "-------- DELETE RESPONSE ---------";
  20. info creatorApiDeleteResp;
The payload looks like this.

  • {"criteria":"(Course_Code==\"SKU TEST01\")"}
I keep getting this error...

  • {"code":1060,"description":"Invalid request parameter found - criteria"}
I've been closely following the documentation and don't understand why this is giving me an error. How can I solve this?

Thanks