Get Related CONTACTS Id of a list of Accounts

Get Related CONTACTS Id of a list of Accounts

Hi There, I am trying to get just the id's of a related contacts from a list of accounts, I can get it to output the full Json info , but i need just the Id's.

I keep getting the following error:

Failed to execute function
  • Argument type mismatch - Found 'NUMBER' but Expected '[KEY-VALUE, LIST, COLLECTION]' for the function 'get' Line Number:50

The code I am using is below:

AccountsList = {4994407000000930940,4994407000000372612,4994407000000372611};
info AccountsList;
ContactList = List();
for each accountele in AccountsList
{

relcont = zoho.crm.getRelatedRecords("Contacts","Accounts",accountele);
info relcont ;
ContactList.add(accountele.get("id"));
}

    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