Creating a flow for Assigned Fundraisers using a switch statement

Options

Hi There,

I am working on a Flow that looks at our daily gifts and if the donor has an assigned Fundraiser, an action is added to their record to call them to thank them for the gift. That part is working fine. Where I am running into trouble is when the record has no assigned fundraiser. In that case I want to still add the action to call and thank, but that will go to a specific staff member to call or triage to thank for the gift.

Here is a screen shot of the overview of the flow where it gets ready to assign. The “Apply to each - For Each Fundraiser” contains the switch statement, it is too large to screen shot, but like I said that part works.

6856513f7e640db85b7135e8e4e74885-huge-im

The switch statement is switching on the Fundraiser ID, so it kind of makes sense that if they don't have a fundraiser assigned there is nothing to switch on. I was hoping that would all trickle into the final “Default” switch, but that is not the case.

Does anyone have a good idea on how to catch those who (made a gift of $500+ and) don't have an assigned fundraiser?

FYI, a single switch looks like this:

193d517844df2b5765026b2ed940037a-huge-im

And the “Default” Switch looks like this:

daaeda1cdac5406ffdc83c607799fbd3-huge-im

Comments

  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 PowerUp Challenge #3 Gift Management Name Dropper

    @John Hazelwood
    First of all, if the switch is working properly great, just find it odd that you had to put double quote around the fundraiser's constituent system record id to force “string” comparison. I don't remember needing to do this.

    as for the default case, it will never land there since there would be no fundraiser meaning, your Apply to each fundraiser's loop will not even be entered.

    Instead, you can have a condition before apply to each fundraiser that check if there is any fundraiser, if yes, go into apply to each fundraiser > switch, if no, the “default” path actions will be moved here.

    A suggestion for better maintenance of the flow: IF each switch case is the same 3 actions (create cosntituent action on fundraiser, get constituent action (not sure what you need this for), and send an email to the fundraiser, then you don't need the actions in the switch. Just have a variable for fundraiser email address, which is set inside the switch. (same for the “no fundraiser” situation, in the condition “false” of not having fundraiser, set the variable of the email of the staff that handle this situation). Then outside of the condition section, create the action, get the action, send the email.

    Benefit of this is, when you need to update the email subject/body, you dont' have to do it to X number of swtich case you have.

  • @Alex Wong

    Thank you, Alex! That worked like a charm! I appreciate your suggestions for better maintenance as well, I will incorporate them into my v2.

    Your help is always appreciated!

Categories