Macro to render external JSON data?

Rune Hellem October 1, 2020

Anyone aware of a macro for Confluence that I can use to render json content, collected from a url? Have several json-files used to prepare various stuff such as DNS-aliases (easier to provide commands for the domain admins than a list of manual tasks).

But for documentation purposes, for all to know which aliases we have, I would like to render this on a page in Confluence.

3 answers

2 votes
Katerina Rudkovskaya _Stiltsoft_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 4, 2020

Hello @Rune Hellem ,

You can try the Table from JSON macro, which is released in the 6.3.0 version of Table Filter and Charts for Confluence.

With the help of this app, you can also filter any kind of data, summarize it and visualize with dynamically updated charts. 

Katerina
Stiltsoft

cuong hoang August 2, 2021

I found that the JSONPath selection is pretty limited, I believe the data has to be in array format only, can't select specific attributes.

When combining with Table Transformer, we still can't select the attributes since that doesn't have any (documented) function for working with json objects.

Like Richard Cross likes this
Katerina Rudkovskaya _Stiltsoft_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
August 3, 2021

Hi @cuong hoang ,

Yes, you shoud set the path to the array. 

Could you please send us your JSON file to our support and clarify what you try to reach with Table from JSON and Table Transformer?

Katerina
Stiltsoft

2 votes
Katerina Kovriga _Stiltsoft_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 4, 2020

Hi @Rune Hellem ,

Try the Table Filter and Charts for Confluence app and its Table from JSON macro.

The macro allows you to output a table from JSON data source (URL or an attached file).

2 votes
Sven Schatter _Lively Apps_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
October 1, 2020

Hi @Rune Hellem,

So, since pulling JSON files that are hosted somewhere is pretty much equivalent to a REST GET request, you could use our app PocketQuery for it. The thing about PocketQuery is that it tries to display your JSON as a table per default which means it expects it to be in this layout:

[
{"columnA": 1, "columnB": 2, ...}, // row 1
{"columnA": 10, "columnB": 20, ...}, // row 2
...
]

PocketQuery however allows you to write Converter functions which let you transform your JSON into something that can be displayed as a table with a few lines of JavaScript. If you have any questions about it don't hesitate to ask here or raise a ticket at our ServiceDesk - we're happy to help! :)

Cheers,
Sven

P.S. If you want a small example of how you could set this up I recommend reading this blog post about PocketQuery.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events