void InsertRowInE123EligibitySheet(map input)
{
rawData = get("data","");
decodedData = rawData.htmlDecode();
data = decodedData.toMap();
sheet_id = "ID GOES HERE";
worksheet_name = "SHEET NAME GOES HERE";
row_data = Map();
row_data.put("Agent ID",data.get("Group ID"));
row_data.put("Unique Identifier",data.get("Member ID"));
row_data.put("Corp ID",data.get("Corp ID"));
row_data.put("Product Code",data.get("Product Code"));
row_data.put("Product Subcode",data.get("Product Subcode"));
row_data.put("Active Date",data.get("Active Date"));
row_data.put("Record Code",data.get("P_Record_Code"));
row_data.put("First Name",data.get("P_FirstName"));
row_data.put("Last Name",data.get("P_LastName"));
row_data.put("Address 1",data.get("Address 1"));
row_data.put("Address 2",data.get("Address 2"));
row_data.put("City",data.get("City"));
row_data.put("State",data.get("State"));
row_data.put("Zip Code",data.get("Zip"));
row_data.put("Email",data.get("Email"));
row_data.put("Phone Number",data.get("Phone"));
response = zoho.sheet.createRecords(sheet_id,worksheet_name,row_data);
info response;
}
Function Execute Test:
Sample Data:
{
"Group ID": "1234",
"Corp ID": "1552",
"Product Code":"434314",
"Product Subcode":"43442",
"Active Date":"01/01/2025",
"P_Record_Code": "1",
"P_FirstName": "John",
"P_LastName": "Smith",
"Address 1": "fsdfsdfsd",
"Address 2": "fsdfsfsfd",
"City": "fdsfsdf",
"State": "fdsfsdfdsfs",
"Zip": "12345",
"Phone": "1231231234"
}
ERROR when testing the Function Execute
"Value is empty and 'htmlDecode' function cannot be applied at line number 4. Resolve the errors and try executing it again"
Flow Custom Function Input:
{
"Group ID": "${trigger.SingleLine4}",
"Corp ID": "1552",
"Product Code":"${var_product_id}",
"Product Subcode":"${setVariable_25}",
"Active Date":"${trigger.Date3}",
"P_Record_Code": "1",
"P_FirstName": "${trigger.SingleLine7}",
"P_LastName": "${trigger.SingleLine8}",
"Address 1": "${trigger.SingleLine13}",
"Address 2": "${trigger.SingleLine14}",
"City": "${trigger.SingleLine15}",
"State": "${trigger.Dropdown7}",
"Zip": "${trigger.SingleLine16}",
"Email": "${trigger.Email}",
"Phone": "${trigger.PhoneNumber}"
}