Search Records within last 7 days based on email address
Hi There,
In workflow I am trying to create a script that checks if new records have matching email address fields with any other lead record created in the last 7 days and then apply a tag to any records found.
Search Records does not seem to support multiple criteria
e.g.
- // Get Record
- resp = zoho.crm.getRecordById("Leads", recordID);
- // Get Email Field
- emailToCheck = resp.get("Email");
- // Calculate the date 7 days ago
- sevenDaysAgo = (currentDate - 7.days);
- // Search for records with the same email in the last 7 days
- search = zoho.crm.searchRecords("Leads", emailToCheck && Created_Time >= sevenDaysAgo);
- //Apply tag to records found
How should I go about it?