Map with "\" when adding text variable

Map with "\" when adding text variable

Hi all,

I'm trying to create an invoice on Quickbooks from Zoho Creator using the intuit.quickbooks.create deluge command.

How it's supposed to work is that the user selects all the Invoice lines from a report, and then it clicks an "Invoice" button that will execute a function to create the Invoice on Quickbooks.

To get the Invoice Lines data I'm using the following code:

//Generate Invoice Lines
InvoiceLines = Map();
LineNum = 1;
AllLines = "";
for each  line in getRevenues
{
InvoiceLines.put("LineNum",LineNum);
InvoiceLines.put("Description",line.Service_Type);
InvoiceLines.put("DetailType","SalesItemLineDetail");
InvoiceLines.put("Amount",line.Total_Amount);
InvoiceLines.put("SalesItemLineDetail",{"TaxCodeRef":{"value":"6"},"ItemRef":{"name":line.Service_Type,"value":"1"}});
//If it's First Line, do not add ,
if(LineNum == 1)
{
AllLines = AllLines + InvoiceLines;
}
else
{
AllLines = AllLines + ", " + InvoiceLines;
}
//Increase LineNum by 1
LineNum = LineNum + 1;
}

The "AllLines" variable ends being as I want, but when I add it to a Map variabl: 
Invoice.put("Line", AllLines);
The Map variable ends up with a lot of  "\". Like this:

{"Line":"{\"LineNum\":1,\"Description\":\"Social Media Consulting\",\"DetailType\":\"SalesItemLineDetail\",\"Amount\":1000.00,\"SalesItemLineDetail\":{\"TaxCodeRef\":{\"value\":\"6\"},\"ItemRef\":{\"name\":\"Social Media Consulting\",\"value\":\"1\"}}}, {\"LineNum\":2,\"Description\":\"Strategy\",\"DetailType\":\"SalesItemLineDetail\",\"Amount\":500.00,\"SalesItemLineDetail\":{\"TaxCodeRef\":{\"value\":\"6\"},\"ItemRef\":{\"name\":\"Strategy\",\"value\":\"1\"}}}, {\"LineNum\":3,\"Description\":\"Content Development\",\"DetailType\":\"SalesItemLineDetail\",\"Amount\":2000.00,\"SalesItemLineDetail\":{\"TaxCodeRef\":{\"value\":\"6\"},\"ItemRef\":{\"name\":\"Content Development\",\"value\":\"1\"}}}","CustomerRef":{"value":"xxxx"}}

Do you know why this happens, or how I can get rid of the " \"??

If you know a better way to create an Invoice on Quickbooks from Zoho Creator with 1 or more lines please let me know.


Thank you.

      Zoho Developer Community









                                Zoho Desk Resources

                                • Desk Community Learning Series


                                • Digest


                                • Functions


                                • Meetups


                                • Kbase


                                • Resources


                                • Glossary


                                • Desk Marketplace


                                • MVP Corner


                                • Word of the Day



                                    Zoho Marketing Automation


                                            Manage your brands on social media



                                                  Zoho TeamInbox Resources

                                                    Zoho DataPrep Resources



                                                      Zoho CRM Plus Resources

                                                        Zoho Books Resources


                                                          Zoho Subscriptions Resources

                                                            Zoho Projects Resources


                                                              Zoho Sprints Resources


                                                                Qntrl Resources


                                                                  Zoho Creator Resources


                                                                    Zoho WorkDrive Resources



                                                                      Zoho Campaigns Resources


                                                                        Zoho CRM Resources

                                                                        • CRM Community Learning Series

                                                                          CRM Community Learning Series


                                                                        • Tips

                                                                          Tips

                                                                        • 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