2

I have a use case that I am trying to solve. Not sure if there is a nice way to do this with a flow and not blow up my SOQL limits.

The org has about 40K contact records. The client would like to have a contact tagged is in our out of their geographic footprint based on the contacts city. There are over 6000 possible city values.

If I create a FootPrint Object would a Flow work to loop through the contact city, compare it to the collection of footprint cities and update a checkbox? Or would my SOQL explode any way I tried to do this? Once the data is set then the flow would only need to run if the field is changed.

2

According to Flow Bulkification in Transactions, a flow should work just fine for your purposes. You wouldn't bulk load all of the footprints into memory at once. You'd construct a list of cities you need, query for those cities, then assign that to another variable, and do whatever DML updates you need to do.

2
  • Thank you for your help @sfdcfox. Question, I built another flow that counts the number of tasks a contact has with certain text in the subject. If I do an upload and don't turn my batch size way down. I will fail for exceeding SOQL limits. I don't understand why these are different. – Brooks Johnson Jun 24 '18 at 12:56
  • @BrooksJohnson It depends on the design of the flow. I suggest you read the documentation carefully; bulkification only works if you're using the same flow on multiple records, and they run in to the same interview element. It sounds like your flow isn't designed to run bulkified, but without seeing it, I can't give specific advice. You might want to ask a new question that includes an image of your flow and how you can optimize it. – sfdcfox Jun 24 '18 at 12:59

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.