I have a client doing SMS outreach with bulk lists, purchased in csv format. Each record in the list is only a few fields, but the list may contain 25K rows. And they're using a lot of these lists.

The response rate is low, of course, so it doesn't make sense to import these as leads until someone has responded.

So, if I save a list in Files (or static resource), I can pull in the data and do a blast out (using the mobile phone number). When they respond, all I've have to identify them is their mobile phone number -- which could be on any one (or more) of these lists. When they respond, I need to go back to the lists, find the phone number, pull the other fields from that record (name, address, etc.) and create a Lead.

I know how to access the data in a File. What I'm looking for guidance on is the smartest way to look up that respondent by their phone number, when the data I'm searching is in a set of attached Files.

I'll be able to track which list has been used when, so my initial thinking is to go in reverse chronology, load in the data from the most recently used list, convert to string, and do an indexOf on the phone number string. If found, grab the data, if not, move on the the next most recently used list.

I'm thinking there might be a faster method using some kind of an index, but I don't have any experience with that. Any suggestions?

I realize that Campaigns probably deals with bulk lists... I'm off to research how they handle it.


Ideally, you should be importing these lists as Lead records. A Lead is a "potential followup", the same as in this dictionary definition:

someone or something that may be useful, especially a potential customer or business opportunity.

You don't know if they will be a customer, but they might be, presumably, or you wouldn't waste marketing dollars on them. Importing them as Lead records, and adding them to various Campaign records, you can track your ROI, conversion rate per data source, etc.

Unless you're worried about storage space, this should be your primary consideration for a data model. Without a database backing, you're going to hit governor limits, most likely heap or CPU limits. Processing data without an index is always a bad idea.

If you absolutely need the space, then maybe you need to consider a different strategy, perhaps using a Heroku database as a backing database, which gives you a lower-cost database infrastructure.

  • Yeah, that's good advice. I may create a Custom object -- Prospects or something like that -- convert to Lead if/when they respond, then come up with an automatic purge after X days to keep overall data size down. – PatMcClellan__c Dec 15 '18 at 14:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.