Extracting Account Name from CRM Contact Records in Creator
I'm building a Creator application where customers submit a monthly status report. I'm provisioning a representative at each customer as a Creator user, using the email address that is in that representative's CRM Contact record. Then that representative will log in to my Creator application after each month ends to submit a report.
When a representative logs in to Creator, I retrieve the login email. Then I want to look up all CRM Contact records with that email, retrieve the Account Name for each matching record, and present the Account Names as choices in a Creator drop list. That way, if a particular person is representing multiple customers for some reason, they can select a particular one for the report. I also plan to retrieve som data from the CRM Account record to pre-populate the status report.
Things seem to be working up until the point I try to iterate through the retrieved CRM Contact records. For a given test login email where I have set up a corresponding test CRM Contact record, I simply get a blank line added to the drop list. Even if I set up more than one matching test CRM Contact record, I still get a single blank line.
Here's the On Load script. Any suggestions?
loginEmail = zoho.loginuserid;
input.User_Email = loginEmail;
crmContactMatches = zoho.crm.searchRecordsByPDC("Contacts", "Email", input.User_Email);
for each matchingContact in crmContactMatches
{
Company:ui.add(matchingContact.get("Account Name"));
}