Listing credited solicitors in a daily gift digest

Hi,

Does anyone know how to go about adding the field in a daily gift digest that will show all the credited solicitors on a gift? We're trying to add the solicitor name to a table using the "append to array variable" action.

Answers

  • Alex Wong
    Alex Wong Community All-Star
    Tenth Anniversary Facilitator 5 Kudos 5 bbcon 2025 Attendee Badge

    here are the outlined flow on how to do it:

    • init variable type array for Gift Digest info
    • init variable type array for Gift Fundraiser (fundraiser = solicitor in the world of webview)
    • list gift
    • apply to each gift in list gift
      • apply to each fundraiser in the fundraiser array (list) within a gift
        • get a constituent for the constituent id of the fundraiser
        • append to array variable of Gift Fundraiser the name dynamic content from the get a constituent action
      • ……do other stuff…..
      • append to array variable of Gift Digest with information you want to show
        • for Fundraiser, you will use the join(variables('Gift Fundraiser'), '<br>') if you are going to show the table directly in email and want each name to be on its own line
      • set var Gift Fundraiser variable to empty array to reset it for next gift
    • create html table
    • send email
  • @Alex Wong Thank you for this, it's very helpful! I followed your instructions but when I ran the flow again I'm getting square brackets "[]" where the fundraisers should be listed. Any idea what I might be doing wrong in my flow?

    image.png
  • Alex Wong
    Alex Wong Community All-Star
    Tenth Anniversary Facilitator 5 Kudos 5 bbcon 2025 Attendee Badge

    "[]" means empty array, and it means you did not use join() expression on the variable for gift fundraiser.

    screenshot on these action steps will help identify your issue:

    • append to array variable of Gift Fundraiser the name dynamic content from the get a constituent action
    • append to array variable of Gift Digest with information you want to show
  • image.png image.png image.png image.png

    @Alex Wong Screenshots and Code are attached.

  • Alex Wong
    Alex Wong Community All-Star
    Tenth Anniversary Facilitator 5 Kudos 5 bbcon 2025 Attendee Badge

    As I thought, you directly added the Fundraiser variable in the array variable of Email content.

    Your Fundraiser variable is an array, which when added directly, it will look like this [] if empty string or ["John Smith", "Mary Jones"] if there was fundraiser for the constituent.

    That is why you need to use the join() expression, which what it does is to "join" string in the array using a "separator" of your selection, see reference doc on how to use join(). if you intent to display the content in email, which looks like you are, you can:

    join(variables('Fundraiser'), '; ')

    or

    join(variables('Fundraiser'), '<br>')

    the latter will put mulitple fundraisers in separate line in HTML

  • @Alex Wong Thanks Alex! That worked. Where within the flow would you recommend putting the action to reset the variable. I currently have it at the top of the loop to get fundraiser and append to array variable.

  • Alex Wong
    Alex Wong Community All-Star
    Tenth Anniversary Facilitator 5 Kudos 5 bbcon 2025 Attendee Badge

    you can do either, as long as the var is "reset" each loop, from my previous post:

    • init variable type array for Gift Digest info
    • init variable type array for Gift Fundraiser (fundraiser = solicitor in the world of webview)
    • list gift
    • apply to each gift in list gift
      • apply to each fundraiser in the fundraiser array (list) within a gift
        • get a constituent for the constituent id of the fundraiser
        • append to array variable of Gift Fundraiser the name dynamic content from the get a constituent action
      • ……do other stuff…..
      • append to array variable of Gift Digest with information you want to show
        • for Fundraiser, you will use the join(variables('Gift Fundraiser'), '<br>') if you are going to show the table directly in email and want each name to be on its own line
      • set var Gift Fundraiser variable to empty array to reset it for next gift ⇐===============
    • create html table
    • send email

Categories