Adaptive Card use with table or array data
I am working on my first NXT adaptive card and I am noticing when adding dynamic content the designer is automatically adding an “apply to each" step. I am guessing because this content returns multiple values from an array or table.
What is the best way to handle this situation, so I only return the value(s) I want in my json payload?
ie How could I pull the note summary for only one note type, or how could I only pull and display a subset of “consent options”
Thanks ahead of time for all the help.
Comments
-
@Mark Zigadlo
the important thing is understands data being returned by the action. You can use developer.blackbaud.com API Reference for the specific API call to understand.if the dynamic content you are trying to add is within an array/list of values, you will get Apply to each from flow automatically. The way to handle is to make a concious decision on if are you expecting always only ONE value or MANY values. Even after using the method below (Filter Array).
after getting a list of notes for constituent, you can use “filter array” action to filter the notes by note type equals to the type you want. filter array will always return an array, since it cannot foresee if there will or will not be only ONE match based on your filter. So if you were to select dynamic content from the filter array action, flow will still put the action you are adding dynamic content from filter array into an apply to each. So the question is now more “business” related, are you expecting ONLY one note of the type you want, or are you expecting MANY. If you know there can ONLY be ONE, then you can use the first() expression to get the first item in the list of item. first() will intake the “body” of the filter array, and then specify the specific property you want. For example: first(body('Filter_Array_Action_Name'))?['summary']
if you are going to access multiple properties of this filtered note, then you can use a Parse JSON with the first(body('Filter_Array_Action_Name')) as the Content. and provide the Schema using sample. this way, your subsequent action can use the dynamic content from the Parse JSON action without having flow putting apply to each automatically.
If you expect there are MANY note that match, then you will need to determine how you want to display the multiple note's information (in a table, in a factset, or concatenated into a string), how you plan to display will affect how you will code to get the info.
2
Categories
- All Categories
- 6 Blackbaud Community Help
- 211 bbcon®
- 1.4K Blackbaud Altru®
- 402 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 360 Blackbaud eTapestry®
- 2.6K Blackbaud Financial Edge NXT®
- 655 Blackbaud Grantmaking™
- 576 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 940 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.7K Blackbaud Raiser's Edge NXT®
- 3.7K SKY Developer
- 248 ResearchPoint™
- 120 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 240 Member Lounge (Just for Fun)
- 34 Blackbaud Community Challenges
- 37 PowerUp Challenges
- 3 (Open) PowerUp Challenge: Grid View Batch
- 3 (Closed) PowerUp Challenge: Chat for Blackbaud AI
- 3 (Closed) PowerUp Challenge: Data Health
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 796 Community News
- 3K Jobs Board
- 54 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)

