Appendix: JSON Element Types
KnowledgeKube includes a number of Elements specifically designed to work with JSON-formatted data. You can use these elements to exchange data with a RESTful API, generate bespoke data, display data in a range of formats, or control the visibility of content based on specific data values.
JSON element tags can be both standalone and wrap-around elements. The following table contains a complete list of JSON elements available to KnowledgeKube applications, including a brief description of each one's purpose and a link to further information you may need to implement it:
Element Name | Description | Sample Markup | Further Reading |
---|---|---|---|
Data | Checks a specific path in a local JSON object and renders the data it contains. | <%# DATA( Keyword="UserDetails" Path="user.name" ) %> |
Appendix: Using the DATA Element Tag |
Data Filter | Retrieves a sub-set of JSON data from a local variable and assigns it to another variable. | <%# DATAFILTER( Keyword="AllBooks" Path="$..book[?(@.isbn)]" NewKeyword="ISBNBooks") %> | Appendix: Using the DATAFILTER Element Tag |
Data Row | Renders the values of one or more items in a JSON array and repeats those values for each row in the array. Each value to return needs to be wrapped in a DATA element. |
<%= DATAROW(KeywordPath) %> |
Appendix: Using the DATAROW Element Tag |
Execute | Makes either a Get or Post request to a RESTful API. | <%# EXECUTE( Keyword="UserDetails" IsAuthenticated="false" RequestUrl="https://site.com" ) %> | Appendix: Using the EXECUTE Element Tag |
Generate JSON | Creates a bespoke set of JSON-formatted data before assigning it to a local keyword. | <%# GENERATEJSON(
Keyword="MyJSON"
Item1Name="Item1Value" Item2Name="Item2Value") %> |
Appendix: Using the GENERATEJSON Element Tag |
Is Data True/Is Data Not True | Displays a block of content if the specified data evaluates to True; otherwise, it will be hidden. | <%= ISDATATRUE( Keyword Path Name Type Expression) %> This content will appear if the data is True <%= %> | Appendix: Using the ISDATATRUE/ISNOTDATATRUE Element Tags |