Updating a Lookup Field on Zoho Deals
Zoho lookup fields can be a bit tricky. When you add data to a lookup field after the primary module for that field is already linked to a deal, the lookup field doesn’t always update as expected. The exact reason for this behavior isn’t entirely clear.
In our case, we updated a field in the Accounts module, which was connected to the Deals module via a lookup field. However, since the account records were already linked to our deals, the lookup field in the deal wasn’t reflecting the updates. The manual solution would have been to disconnect and reconnect each account to its respective deal.
Given that we needed to update over 200 deals, manually making these changes would have involved a lot of tedious clicking just to refresh the lookup field.
Instead, I used ChatGPT 4 Canvas to write a script that automatically re-associated the accounts with the deals. The script took about a minute to run, and it was remarkably simple. I’ve shared the code on my GitHub for anyone who wants to use it as a reference.
The basic workflow looked like this.