Error when pulling package information
On my gift digest, I would like to show the package id. Since every gift does not include a package, I am getting this error:
Unable to process template language expressions for action 'Condition_2' at line '0' and column '0': 'The template language expression 'first(item()['gift_splits'])['package_id']' cannot be evaluated because property 'package_id' doesn't exist, available properties are 'id, amount, appeal_id, campaign_id, fund_id'. Please see https://aka.ms/logicexpressions for usage details.'.
I tried adding in a condition that if the “package id” was blank, but I still have the above error. This is because the package ID is not a field on gifts that don't include a package.
Anyone else figure out a good way to handle this?
Comments
-
Hey @Amanda Holt, instead of using a conditional to check if the property is blank, try using an expression with an If statement that checks to see if the property is empty. The way I have it set up below returns True if the property is empty or does not exist and false if it does (you may want to reverse those). Then you can use the output of the Compose in your conditional.
Caveat to this: we don't use that field so I just guessed on what the JSON object looks like. You'll have to construct the actual output for the package_id property.
0 -
@Matt Thacker. I tried that but can't seem to get it to work. Got the error:
Array elements can only be selected using an integer index
I think part of the problem is that sometimes the package ID is there and sometimes it is not.
For example, under “get a gift" here is the result for the first gift in the list:
But for the second gift, this is the result:
You can see the package ID is not always listed for a gift. It is only included if the package ID has a value.
Maybe this is unrelated to the error I receive, but it certainly is complicating the flow to account for the difference.
0 -
@Amanda Holt, does your expression look like this? I didn't realize you were accessing a property in the Gift Splits property. You need to use an array index to access the properties within Gift Splits.
if(empty(outputs('Get_a_gift')?['body']?['gift_splits'][0]?['package_id']), false, true)
2 -
@Matt Thacker. That seemed to do the trick. I had used a similar expression but it wasn't working. Thanks so much for the help!
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