ZoHo Flow Custom Function not Processing JSON

ZoHo Flow Custom Function not Processing JSON

JSON is being escaped and converting all the quotes in the JSON to '"' 

Here's the Code: 
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}"
}

Testing Input: 
o

{
   input : "{ "Group ID": "123456",  "Corp\nID": "1552",  "Product\nCode":"46523",  "Product\nSubcode":"9376", "Active\nDate":"01/01/2025", "P_Record_Code":\n"1", "P_FirstName":\n"Christopher", "P_LastName":\n"Anderson", "P_DoB":\n"No", "P_Gender":\n"M", "P_SSN":\n"231-23-1232", "Address 1":\n"771 Outlook Dr", "Address 2":\n"", "City":\n"Ponte Vedra", "State":\n"Florida", "Zip":\n"32081", "Email":\n"chris.anderson70@gmail.com", "Phone":\n"19046379244", "Smoker":\n"No" }"
}

Testing Output: 
"Value given for the variable 'input' does not match its type due to invalid JSON format at line number 1. Resolve the errors and try executing it again"


    Access your files securely from anywhere

        All-in-one knowledge management and training platform for your employees and customers.






                              Zoho Developer Community




                                                    • Desk Community Learning Series


                                                    • Digest


                                                    • Functions


                                                    • Meetups


                                                    • Kbase


                                                    • Resources


                                                    • Glossary


                                                    • Desk Marketplace


                                                    • MVP Corner


                                                    • Word of the Day


                                                    • Ask the Experts





                                                              Manage your brands on social media



                                                                    Zoho TeamInbox Resources



                                                                        Zoho CRM Plus Resources

                                                                          Zoho Books Resources


                                                                            Zoho Subscriptions Resources

                                                                              Zoho Projects Resources


                                                                                Zoho Sprints Resources


                                                                                  Qntrl Resources


                                                                                    Zoho Creator Resources



                                                                                        Zoho CRM Resources

                                                                                        • CRM Community Learning Series

                                                                                          CRM Community Learning Series


                                                                                        • Kaizen

                                                                                          Kaizen

                                                                                        • Functions

                                                                                          Functions

                                                                                        • Meetups

                                                                                          Meetups

                                                                                        • Kbase

                                                                                          Kbase

                                                                                        • Resources

                                                                                          Resources

                                                                                        • Digest

                                                                                          Digest

                                                                                        • CRM Marketplace

                                                                                          CRM Marketplace

                                                                                        • MVP Corner

                                                                                          MVP Corner









                                                                                            Design. Discuss. Deliver.

                                                                                            Create visually engaging stories with Zoho Show.

                                                                                            Get Started Now


                                                                                              Zoho Show Resources

                                                                                                Zoho Writer

                                                                                                Get Started. Write Away!

                                                                                                Writer is a powerful online word processor, designed for collaborative work.

                                                                                                  Zoho CRM コンテンツ




                                                                                                    Nederlandse Hulpbronnen


                                                                                                        ご検討中の方