I am working on a data migration, reading the data from the Certifications tabular section from the employee form to insert them in a new form (Certifications2).
I created a record in my new form for each employee using the import.
// Create map to hold search condition - Get the Employee Record from the Employee Form
searchMap1 = Map();
searchMap1.put("searchField","EmployeeID");
searchMap1.put("searchOperator","Is");
searchMap1.put("searchText",'9994');
// Execute the get records task to fetch the search result
response = zoho.people.getRecords("P_Employee",0,1,searchMap1);
// Retrieve the value for the key field Zoho_ID
ZohoID = response.get(0).get("Zoho_ID");
info ZohoID;
recordid = ZohoID;
// Get info in the Certifications Tabular Section from the Employee form
CertifRec = response.getJSON("tabularSections").getJSON("Certifications");
///info CertifRec;
sectionid = 67512000071010042;
for each RecordList in CertifRec
{
CertifCertification = RecordList.get("Certification");
CertifPassDate = RecordList.get("PassDate");
CertifAttempt = RecordList.get("Attempt");
CertifPDF = "";
info "Certification = " + CertifCertification;
info "PassDate = " + CertifPassDate;
info "Attempt = " + CertifAttempt;
///////////////////////////////////////////////////////////////
/// 2) Push data in the Tabular section of the new form
/////////////////////////////////////////////////////////////
data = "{\"" + sectionid + "\" : {\"add\": [{\"Certification\": \"" + CertifCertification + "\",\"Pass_Date\": \"" + CertifPassDate + "\",\"Attempt\": \"" + CertifAttempt + "\",\"Certificate_PDF\": \"" + CertifPDF + "\"}]}}";
info "data = " + data;
dat = Map();
///dat.put("EmployeeRecordID",recordid);
dat.put("recordId",recordid);
dat.put("tabularData",data);
url = https://people.zoho.com/people/api/forms/json/Certifications2/updateRecord?;
respo = invokeurl
[
url :url
type :POST
parameters:dat.toMap()
connection:"people_authorization"
];
info respo;
}
---------------------------------------------------------------------------------------------------------------------------
67512000042599277
Certification = ADOBE Certified Expert - AEM Business Practitioner
PassDate = 01-Nov-2022
Attempt =
data = {"67512000071010042" : {"add": [{"Certification": "ADOBE Certified Expert - AEM Business Practitioner","Pass_Date": "01-Nov-2022","Attempt": "","Certificate_PDF": ""}]}}
{"response":{"message":"Error occurred","uri":"/api/forms/json/Certifications2/updateRecord","errors":{"code":7049,"message":"No record available with the specified record ID"},"status":1}}
Writer is a powerful online word processor, designed for collaborative work.