Need some help

Options

Happy Friday the 13th!! We have been running some regular gift reports. Everything has been working just fine. We are now looking to add more information to the reports, specifically some gift custom fields. We a specific gift comes in for a program, we are tracking data on two different custom fields. I am having an issue getting the filter to work. I have tried using a control condition and a filter array…but am not having success. What I am also struggling with is bringing both values back and putting them in an HTML table. So you see, you are taking two lines of data and putting them side by side. The start of the flow is pretty simple…. reoccurrence, then I initialize a couple of array variables, grab the gift list from RE, and then count a number of records. All standard template flows from Blackbaud (Thank you). For each gift returned,I get gift details, format the amount field, then get the donor name, and list gift custom fields. Here is where I am struggling….

20b1e914438a471aad012a2f1f7a4428-huge-im

The rest of it is standard, get the array into HTML, clean up HTML, add a class (style sheet) and then email the report. What am I missing? Any help would be appreciated.

Comments

  • Hey @Bob Rickards, in the Filter Array step, try changing the Category to an expression item()?['Trip'] — I think that's what that value is the object you created.

  • @Matt Thacker so changing the filter array from basic to advance makes the expression: @equals(items('Apply_to_each')?['category'], 'Trips Locations') Does the apply to each need to be there?

  • @Bob Rickards want to make sure I'm understanding correctly: Are you trying to filter the GiftDigest array that you append to in the previous step?

  • @Matt Thacker Yes…see the data below…highlighted fields are what I want. I get the list to produce this prior to trying to filter. Now when I filter, it errors out. I want the Trips Location and the Students's Name. Both are held in the field under the respective Categories.

    DonorAddressGift TypeAmountCategory
    Ms. Pauline Forrest Donation Receipt Letter Type
    Ms. Pauline Forrest Donation Student Name
    Ms. Pauline Forrest Donation Trips Locations
    Ms. Pauline Forrest Donation Receipted
    Mr. Bill E. Hennes Donation Receipt Letter Type
    Mr. Bill E. Hennes Donation Trips Locations
    Mr. Bill E. Hennes Donation Student Name
    Ms. Kristan Huberty Donation Receipt Letter Type
    Ms. Kristan Huberty Donation Student Name
    Ms. Kristan Huberty Donation Trips Locations
    Ms. Kristan Huberty Donation Receipted
    Ms. Theresa Jones Donation Online Express Page URL

    Bob

  • @Bob Rickards- Hi Bob- are you still working on this? I think you need to do a filter array after you list custom fields. This will limit the custom fields to only the ones you want.

    As Matt said you do want to do Advanced mode in the Filter Array. You can do multiple values but I would recommend doing it in Notepad first then pasting it in.

    It would be something like

    @and (equals (item()?['category'], 'Trips Locations'), (equals (item()?['category'], 'second type'))

    In your Digest array, you want to pull in the Filtered Array value of the custom field. If that's what you are looking for.

    You should try to delete the Apply to each you don't need it after you do the filter array like above.

    Carol Grant

    Middlebury College

    Middlebury, VT

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

    @Bob Rickards
    You don't need Apply to each.

    After List gift custom fields action for a gift, you will do 1 Filter array action to get the Trip Locations custom field, another Filter array action to get the Student Name custom field. (Assuming these are unique custom field, meaning 1 gift allow only 1 of such custom field). Then just add the filtered result into your array of gifts. (below is sameple, you MAY need to do additional expression to test if the length() of each Filter array action is not 0, which I did not include in the check.

    be5e5464384940f5a0f724c369282546-huge-im
    ae196ce2cbf00f9096440022c4d5285d-huge-im

    {
    "Gift Type": "@{outputs('Get_a_gift')?['body/type']}",
    "Amount": @{outputs('Get_a_gift')?['body/amount/value']}
    "Trip Locations": "@{first(body('Filter_array_for_category_of_Trips_Locations'))?['value']}",
    "Student Name": "@{first(body('Filter_array_for_category_of_Student Name'))?['value']}"
    }

    Notice I use expression function first() to only get only first value (assume there is ONLY 1 of each Trip Locations and Student Name custom field). If custom field is multiple (i.e. maybe Student Name has multiple custom fields), you can add a SELECT action to select the value of the filtered list, then use the join() expression to join mulitple Student Names into a comma, semi-colon, separated list of names.

    bdabd4f7ef0d2211b8f533696f9e29fc-huge-im

    {
    "Gift Type": "@{outputs('Get_a_gift')?['body/type']}",
    "Amount": @{outputs('Get_a_gift')?['body/amount/value']}
    "Trip Locations": "@{first(body('Filter_array_for_category_of_Trips_Locations'))?['value']}",
    "Student Name": "@{join(body('Select_Student_Name'), '; ')}"
    }

  • @Alex Wong Thanks for the help….completely understand the solution, but every time I try to add the second filter, it adds an ‘apply to each’ operation. Any suggestions?

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

    @Bob Rickards
    If you getting a “Apply to each” automatically put in, that means you selected the wrong dynamic content. “value” as a name is used in the individual value of the attribute too. The value you are looking for has to be the “value” dynamic content that is targetting the “array” of gift custom field values, which has the “description” that say “The set of items included in the response….” instead of “The value of the custom field.

    8227701c2dd220e747647312e32c2c17-huge-im
  • @Alex Wong That worked….Thanks so much!!

Categories