Getting the Account ID

Now that we have the address information from the Contact record, we want to update the Account record. Remember the following:

  • Lookup fields are special, they relate records to each other
  • In the Contacts modules, there is a lookup field to the Accounts module, in this case showing that Obi Wan is associated with “The Republic” account
  • Zoho uses the unique, 19-digit ID numbers in these lookup fields, so, the Account ID we need is actually stored in the Accounts lookup field in the Contact record, which is a variable we created in our function
  • As seen in the JSON Viewer, the “id” of the Account record is a sub-field to the “Account Name” so we use a double “Get” function to retrieve this unique ID number, seen below:

accountId = contactRecord.get(“Account_Name”).get(“id”);

  • Remember that every Zoho CRM record (and most all Zoho records PERIOD) have an ID like this, and they all function more-or-less in the same way.

JSON VIEWER