Function to Map a Text Field to Pick List Within Same Module
My scenario is I have a Gravity Form select field that a lead selects from and I need to map this to a pick list option within the Zoho Leads module. Now, as we know, using the Gravity Forms to Zoho plugin this isn't possible, so the solution is to pass the data to a Zoho text field and then have that field map to the corresponding pick list (as detailed in the topic above).
I have the data populating the text field but I'm struggling to get this to map to the pick list.
Here's my function;
- resp = zoho.crm.getRecordById("Leads", leadID);
val = ifnull(resp.get("Initial_Lead_Source"),"");
mp = map();
mp.put("Lead_Source", val);
info "Map : "+mp;
upd = zoho.crm.updateRecord("Leads", leadID, mp);
If I hit 'save and execute' and enter a lead ID, it works, but I need this to happen automatically upon lead creation.
Can anyone help?
EDIT - Ended up creating a workflow rule to achieve this.