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"));
}

          Zoho Marketing Automation
                  • Sticky Posts

                  • Function #41: Sync Associated Subforms!

                    Welcome back everyone! The last custom function showed how to update a Contact with Product details from it's Related list in Deals. This week, let's look at a function that lets you update subform records in two modules simultaneously when one of them is updated. Business scenario Let's look at how subform helps in an education institution that has deployed Zoho CRM. National Public School, Austin (made up, of course!) has set up Zoho CRM and it follows the same relationship pattern of "Students",

                  Zoho Pagesense Resources

                    Zoho SalesIQ Resources



                          Zoho TeamInbox Resources

                            Zoho DataPrep Resources



                              Zoho CRM Plus Resources

                                Zoho Books Resources


                                  Zoho Subscriptions Resources

                                    Zoho Desk Resources

                                      Zoho Projects Resources


                                        Zoho Sprints Resources


                                          Qntrl Resources


                                            Zoho Creator Resources


                                              Zoho WorkDrive Resources





                                                  Zoho Campaigns Resources

                                                    Zoho CRM Resources

                                                          Design. Discuss. Deliver.

                                                          Create visually engaging stories with Zoho Show.

                                                          Get Started Now