Daily Gift Notifications with Gift Custom Fields, Receipt and Acknowledgement Flag

Hi

I've been scouring the PA examples and haven't found one (I may have missed it) that helps me figure these out. I've been tasked with building a daily list of gifts with their receipt flag (Receipted, Not Receipted, Do Not Receipt), Acknowledgment Flag and even some custom gift fields. I know I can use the Last function to grab the receipt flag, but I can't seem to get the correct syntax. This is wrong:

first(outputs('Get_a_gift')?['body/receipts/status'])

Does anyone know the correct syntax to use First or Last function?

Does anyone have a sample PA flow that captures Receipt, Acknowledgement fields and Custom Gift Fields?

Thank you
Cathy

Answers

  • Cathy, I use tools other than PA but custom gift fields are a separate end-point. I generally capture all gift data, including all gift attributes/custom-fields and put all that (along with a lot other data) in a DW. I can then do whatever reporting is needed with no other impediments.

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

    first() and last() takes in an array. the array (list of) in question is receipts

    so that would mean you need to: first(outputs('Get_a_gift')?['body/receipts'])?['status']

    so same with acknowledgements: first(outputs('Get_a_gift')?['body/acknowledgements'])?['status']

    as for custom field, you need to get custom fields by gift id first, then for each "category" of custom field you want to display, you will need to use a "Filter array" action on category=to the category you want.

    if you know your category is unique, then you can use first() or last() as well.

    if you know your category is not unique (1 gift can have more than one of the category you want to display), you are going to need to do a little more using Select action and join() expression.

  • Thank you both .. very helpful Alex .. I'll dive in further. :)

Categories