Attaching a file to a CRM Deal through Flow

Attaching a file to a CRM Deal through Flow

We have a Flow that is grabbing particular emails from an inbox, running them through Flow's DocaMatic interface and converting them to a PDF, then we're trying to attach them to a Zoho deal. This last step we're trying to accomplish with this following custom function:

map attachFiletoDeal(int dealID, string pdfURL)
{
pdfFile = invokeurl(pdfURL,"GET");
return zoho.crm.attachFile("Deals",dealID,pdfFile,"zoho_crm_connection");
}

All of the steps of our flow succeed, including the last one which is a call to this function. From a successful history entry, here is the input:

{
        "dealID": 2500568000043526001,
        "fileID": "https://docamatic.s3.eu-west-1.amazonaws.com/prod/11781570-e8b5-4b5f-ba89-5ad9606763e2/01beeb65-0de7-4259-bb69-d8563d53ba89.pdf"
}

The fileID was verified to exist (though it gets deleted after 24 hours).

Here is the very odd output:

{
        "attachFiletoDeal_7": null
}

Why would zoho.crm.attachFile() return null?

What is weirder is when I "Execute" the function from within Zoho Flow and manually enter the exact input values above, it attaches the file!!

Can anyone please help me figure out what's going wrong?


    Access your files securely from anywhere

        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 Campaigns 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