0

Question edited per feedback...

The problem at its core: I need to be able to assign net new accounts to various groups of people based on a large list of billing zip codes. In some cases, I only need to assign based on the billing State. I'm not a programmer, so I would like to accomplish this with a lightning Flow.

Not sure if this is important or if it will serve to confuse things further, but here's what I've already built in an attempt to solve this:

Objects I've created:

  1. Zip Code Group - to house groups of zip codes
  2. Zip Code Group Member (Master-Detail Relationship) - basically, zip codes
  3. Account
  4. Record Assignment Group (groups of users based on region)
  5. Record Assignment Group Member (the users)

I have an Account-based record-triggered flow. Here's what is already working in the flow: When an account is created, if billing state = "x", assign new account to a group member in the appropriate Assignment Group. This already works. However, when I attempt to reference the list of zip codes in the decision element, it doesn't pull back expected result.

I built the flow with a Get Records element to get all Zip Code Group Member records, and next, I have a decision element that includes filters for "Billing State/Province", but I can't figure out how to reference the Zip codes in a filter. I've tried Collection Filters, and the debug log DID show the Collection Filters pulled back results, however when I attempted to filter in the decision element on items in Collection Filter, it returned null.

How can I accomplish the above requirement?

3
  • 1
    Hi, and welcome to SFSE! In order to better assist you, we need more detailed information about your process. As written, this is basically an X-Y Problem, meaning we have to make a ton of possibly incorrect educated guesses about the actual algorithm that may be incorrect. I feel like your final flow should literally be six or seven total elements, not the 20+ you've laid out here. Clues are things like "Get All Zips" and large branches. Start from the base problem, and let us give you a solution. You can edit your question.
    – sfdcfox
    Apr 8 at 3:58
  • Thanks for the reply - I will edit my question. Here's the problem. I need to be able to assign net new accounts to various groups of people based on a large list of billing zip codes. I'm not a programmer, so I would like to accomplish this with a lightning Flow. Apr 8 at 16:19
  • My suggestion is you use edit and post a screenshot of the failing Flow elements including the related debug output
    – cropredy
    Apr 10 at 16:54

1 Answer 1

0

I've tried Collection Filters, and the debug log DID show the Collection Filters pulled back results when I attempted to filter in the decision element on items in Collection Filter, it returned null

It sounds like you are not having technical difficulties, but that you need help designing the solution. I'll give my take below, but in the future, you really should provide full details about what you have built -- that includes the elements in the flow, the full debug logs, the data you used for the test, etc. Don't shy away from providing screenshots.

Solution:

  1. Record-triggered Flow, triggered by new Account record
  2. Decision: If State equals "x", assign to particular group
  3. If state was not a match, then Get the Zip Code Group Member Record where the ZIP Code field from the Zip Code Group record matches the ZIP Code on the Account record. (Just get that one record). In this step, include all fields from that record. This will include the field containing the Zip Code Group.
  4. Decision: If ZIP Code Group = "y", assign to particular group

I don't see any reason to bring all zip code records into the flow, or any reason to use the Collection Filter. Just look up the Zip Code record that matches the ZIP code from the Account.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .