A quick article on how I resolved this error and how the online forums and documentation did not.
Why?
I don't often do this to create a Creator record but I'm going to use the shortcode function zoho.creator.createRecord() and wanted to update the first name of a name field but I was getting the following error:
{ "code": 2945, "description": "EXTRA_KEY_FOUND_IN_JSON" }
How?
So the quick answer is to build a nested map in your request instead of using the Creator/JavaScript period/dot character...
Some might suggest it's an authorization error but if you do a getRecordById and it works then the connection string is fine.
What I was doing?:
I'm not saying this is the solution to whenever you get the above error; I'm just saying this what I was doing and this is what fixed it when I ran into this error:
copyraw
// initialize
m_QuoteRecord = Map();
//
// build quote request
m_QuoteRecord.put("Name.first_name",v_SellerName_Firstname);
m_QuoteRecord.put("Name.last_name",v_SellerName_Lastname);
m_QuoteRecord.put("Email",v_SellerEmail);
//
// other params
m_Blank = Map();
//
// send the request
r_Create = zoho.creator.createRecord(zoho.adminuser, zoho.appname, "Quote", m_QuoteRecord, m_Blank, "my_creator_connection");
//
// FAILS: with r_Create = {"code":2945,"description":"EXTRA_KEY_FOUND_IN_JSON"}
- // initialize
- m_QuoteRecord = Map();
- //
- // build quote request
- m_QuoteRecord.put("Name.first_name",v_SellerName_Firstname);
- m_QuoteRecord.put("Name.last_name",v_SellerName_Lastname);
- m_QuoteRecord.put("Email",v_SellerEmail);
- //
- // other params
- m_Blank = Map();
- //
- // send the request
- r_Create = zoho.creator.createRecord(zoho.adminuser, zoho.appname, "Quote", m_QuoteRecord, m_Blank, "my_creator_connection");
- //
- // FAILS: with r_Create = {"code":2945,"description":"EXTRA_KEY_FOUND_IN_JSON"}
The correct code
copyraw
// initialize
m_QuoteRecord = Map();
//
// build quote request
m_SellerName = Map();
m_SellerName.put("first_name", v_Name_Firstname);
m_SellerName.put("last_name", v_Name_Lastname);
m_QuoteRecord.put("Name",m_SellerName);
//
m_QuoteRecord.put("Email",v_SellerEmail);
//
// other params
m_Blank = Map();
//
// send the request
r_Create = zoho.creator.createRecord(zoho.adminuser, zoho.appname, "Quote", m_QuoteRecord, m_Blank, "my_creator_connection");
//
// SUCCEEDS: with r_Create = {"code":3000,"data":{"ID":"1234567000012345678"},"message":"Data Added Successfully"}
- // initialize
- m_QuoteRecord = Map();
- //
- // build quote request
- m_SellerName = Map();
- m_SellerName.put("first_name", v_Name_Firstname);
- m_SellerName.put("last_name", v_Name_Lastname);
- m_QuoteRecord.put("Name",m_SellerName);
- //
- m_QuoteRecord.put("Email",v_SellerEmail);
- //
- // other params
- m_Blank = Map();
- //
- // send the request
- r_Create = zoho.creator.createRecord(zoho.adminuser, zoho.appname, "Quote", m_QuoteRecord, m_Blank, "my_creator_connection");
- //
- // SUCCEEDS: with r_Create = {"code":3000,"data":{"ID":"1234567000012345678"},"message":"Data Added Successfully"}
Source(s):
- Zoho Creator / API Status Codes
- Zoho Community / Zoho One / Using Zoho One
- Zoho Community / Zoho Creator / Application Development
- Zoho Deluge / Integrations > Pre-defined integrations with Zoho services > Zoho Creator Integration Tasks > Get Record by ID
Category: Zoho :: Article: 859



Add comment