Payments BBPS Transaction ID
I'm trying to add the BBMS transaction ID, which is included automatically by Online Express, to gifts received via web view donation and registration forms.
However, every time I try to add it, the Apply to Each control starts nesting itself very strangely, and the flow does not work, giving me an error of “The execution of template action 'Apply_to_each_2' failed: the result of the evaluation of 'foreach' expression '@items('Apply_to_each')' is of type 'Object'. The result must be a valid array.” This is despite PA choosing the field as “current item” itself.
This odd nesting ONLY happens when I add they dynamic content field Payments BBPS Transaction ID. Other fields do not cause this issue. Does anyone have an idea why and/or a work around?
TYVM!
Comments
-
@Emmet OConlon
The error message seems to be good indicator that the “dynamic content” used is not an array. Apply to each can only accept an array to “loop” through each element of an array.Power Automate is pretty good at “placing” the correct array dynamic content, so there got to be something with the way you are adding action and dynamic content to those action. Hard to help you investigate without some more info. Please provide additional screen shots
0 -
@Alex Wong Here is what it looks like before I add the Payments BBPS Transaction ID:
I consider this “normal.” Now, look what happens to the structure after I add that particular field:
I've tried changing out the “Current item” in the second Apply to Each to “value," but that yields PA to try to add the attribute at least twice in some sort of weird loop.
0 -
@Alex Wong I've found a solution, but I'm not sure why it works.
I used Get Gift after the Apply to Each step to successfully get the BBMS transaction ID (called bbps_transaction_id) in a variable. After that, I was able to update the transaction ID successfully.
Screenshot of revised flow below.
0 -
@Emmet OConlon
Glad you got this working for you.So if you want to dive into the details on how and why, here it is, and some tip on simplifying the flow:
- After your List gifts action, you actually do not need to do a Condition action as the condition is simply if Count is greater than 0
- The Apply to each action will loop through the gifts in your List gifts action, so if there is nothing (Count = 0) the Apply to each will simply exit and not execute any actions within it
- The problem you encountered is a “gitchiness" of Power Automate flow, I can't explain why, but here's the reason for the failing:
- if you look at the API documentation for List Gift (https://developer.sky.blackbaud.com/docs/services/58bdd5edd7dcde06046081d6/operations/ListGifts), go down to the Response 200 OK section and click on Schema, do a browser find on “bbps”, you will find that bbps_configuration_id and bbps_transaction_id is a String property inside payments. payments is an array itself.
- because payments is an array, when you reference the bbps_transaction_id property, flow will put another Apply to each that loops through the payments array. This is where flow failed, and put the wrong dynamic content for you that caused the error you saw.
- To do this properly, you can simply add a Apply to each action yoursevles (don't let flow do it). Then in the * Select an output from previous steps, select the Payments dynamic content (the one that has desscription that say “The payments on the gifts”)
If you want to go a little more “clean”, KNOWING that there really is ONLY ONE payment object in the Payments dynamic content array, you can use the first() expression to get the first payment object in the array, and get the bbps_transaction_id off the first payment object.
@{first(items('Apply_to_each_gift_from_List_gifts')?['payments'])?['bbps_transaction_id']} 1 - After your List gifts action, you actually do not need to do a Condition action as the condition is simply if Count is greater than 0
Categories
- All Categories
- 6 Blackbaud Community Help
- High Education Program Advisory Group (HE PAG)
- BBCRM PAG Discussions
- Luminate CRM DC Users Group
- DC Luminate CRM Users Group
- Luminate PAG
- 186 bbcon®
- 1.4K Blackbaud Altru®
- 389 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 14 donorCentrics®
- 355 Blackbaud eTapestry®
- 2.4K Blackbaud Financial Edge NXT®
- 616 Blackbaud Grantmaking™
- 542 Blackbaud Education Management Solutions for Higher Education
- 33 Blackbaud Impact Edge™
- 3.1K Blackbaud Education Management Solutions for K-12 Schools
- 909 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 207 JustGiving® from Blackbaud®
- 6.2K Blackbaud Raiser's Edge NXT®
- 3.5K SKY Developer
- 236 ResearchPoint™
- 116 Blackbaud Tuition Management™
- 375 YourCause® from Blackbaud®
- 160 Organizational Best Practices
- 232 The Tap (Just for Fun)
- 31 Blackbaud Community Challenges
- Blackbaud Consultant’s Community
- 19 PowerUp Challenges
- 3 Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 Raiser's Edge NXT PowerUp Challenge: Events
- 3 Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 Raiser's Edge NXT PowerUp Challenge #1 (Query)
- 71 Blackbaud Community All-Stars Discussions
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 743 Community News
- 2.8K Jobs Board
- Community Help Blogs
- 52 Blackbaud SKY® Reporting Announcements
- Blackbaud Consultant’s Community
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)
- Blackbaud Francophone Group
- Blackbaud Community™ Discussions
- Blackbaud Francophone Group