table lookup
Asked by Craig Beaubien:

We have Confluence Server with the following installed:

* Adadtavist scriptrunner for confluence
* Oomposition
* Confluence source editor
* Viewtracker -- analytics for confluence

We use Confluence for a Wiki type system for information on our products. Most of the pages have tables and I want to have a column to indicate whether a particular product is under warranty or not based on a separate spreadsheet. Can I do this with these products or would I need something else?

Thanks,


Answers:
author: Sven Schatter _Lively Apps_
body: Hi [@Craig Beaubien](/t5/user/viewprofilepage/user-id/4059716),

It sounds a bit to me like this is more of a manual process for you, but do you have this data available in a database or via a REST API? If yes, you could use our app [PocketQuery](https://marketplace.atlassian.com/apps/1211199/pocketquery-for-confluence-sql-rest?utm_source=atlcom) to dynamically pull in the data for a given product.

For example, you could create a Query called "warranty_check" which has a "product_id" parameter. You can then insert the PocketQuery macro into your pages and have it render the warranty status of your products, based on the product_id (which you can specify in each macro). Going further, you could even use PocketQuery to pull in the whole table containing your product information from an external datasource - given that it's available in a database or REST API of yours.

Cheers,  
Sven


author: Katerina Kovriga {Stiltsoft}
body: Hi [@Craig Beaubien](/t5/user/viewprofilepage/user-id/4059716),

We can recommend our app - [Table Filter and Charts for Confluence](https://marketplace.atlassian.com/apps/27447/table-filter-and-charts-for-confluence?hosting=server&tab=overview).

If I've got your case right, you have the following situation: there are many small tables related to the special types of products on different pages in your Wiki.

![1.png](https://community.atlassian.com/t5/image/serverpage/image-id/111639i9A19E217526C8B67/image-size/large?v=v2&px=999 "1.png")

The Product name (the first column) is a unique value.

Then you have one big table with all the products listed that you use to display the warranty status.

![8.png](https://community.atlassian.com/t5/image/serverpage/image-id/111640iE0824C2967DFA3DA/image-size/large?v=v2&px=999 "8.png")

The case is to lookup the warranty statuses with the products in your small tables automatically.

**The first step** is to reuse your big table with the Warranty Status column on the every page containing a small table. It is very convenient - all the changes made to the source table will be automatically reflected in the reused tables. Let's use the [Table Excerpt/Table Excerpt Include](https://docs.stiltsoft.com/display/public/TFAC/How+to+use+Table+Excerpt+and+Table+Excerpt+Include+macros) macros for this purpose.

![2.png](https://community.atlassian.com/t5/image/serverpage/image-id/111642i66985F4435E3E506/image-size/large?v=v2&px=999 "2.png")

**The second step** is to lookup every small table with the reused big one. Let's use the Table Tranformer macro and its default Lookup preset.

![3.png](https://community.atlassian.com/t5/image/serverpage/image-id/111643iE62276B898EFF9DD/image-size/large?v=v2&px=999 "3.png")![4.png](https://community.atlassian.com/t5/image/serverpage/image-id/111644iFF9559CC74B0CCAF/image-size/large?v=v2&px=999 "4.png")![5.png](https://community.atlassian.com/t5/image/serverpage/image-id/111645i968C320865DEC691/image-size/large?v=v2&px=999 "5.png")**The third step** is to hide extra table rows that we don't need to show - we'll use the [Table Filter](https://docs.stiltsoft.com/display/public/TFAC/How+to+use+Table+Filter+macro) macro for this task.

![6.png](https://community.atlassian.com/t5/image/serverpage/image-id/111646iE13EB2E2F7199699/image-size/large?v=v2&px=999 "6.png")![7.png](https://community.atlassian.com/t5/image/serverpage/image-id/111647i548ED2A52CE9AF99/image-size/large?v=v2&px=999 "7.png")Now, as you see in the macro preview, your case is fully accomplished.

Feel free to try out the app - there is one month of free usage. You'll see that the app is very flexible and allows you to nest macros in different combinations so that to filter tables, modify them, perform calculations, create pivots and different charts.


Tags: billing

new-to-confluence

server