Comparing 2 collections to make an action

Comparing 2 collections to make an action

Salut,

I have a customer form with a main phone number, and a secondary phone number.

I have another form, a calendar, with a paste of the main phone number.

I want to send a SMS to both phone numbers when the calendar event happen. I use the following script for the main phone number and it works:

CustList = Customers[Recalls = true].distinct(MainPhone);
CalendarList = Calendar[EventDate == zoho.currentdate].distinct(MainPhoneCalendar);
for each  MainPhone in CustList
{
    if(CalendarList.contains(MainPhone))
    {
        Reponse = twilio.sms.send("twilio_connection",MainPhone,"RAPPEL : Livraison de vos légumes bio aujourd'hui");
    }
}

The problem is with the secondary phone number which do not appear in the Calendar form, only in the Customers form. I basically need a script that says : If  X phone number has a calendar event, go see where that phone number appears in the customers' records and fetch the secondary phone in the action. And it is for many records each time.

Don't see how to do that.

Sylvain

      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive 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




                            Zoho Writer Writer

                            Get Started. Write Away!

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

                              Zoho CRM コンテンツ






                                ご検討中の方