Can I use part of a table in and Excerpt and can I create a table from multiple Excerpt-Includes?
Asked by Andrew Dacey:

I want to use the data part of a table while leaving out the header row so that I can add several excerpts to form a bigger table. Help, ideas, comments??


Answers:
author: Vivek Rao
body: Thanks for the detailed answer. TBH, it seems like way more work than benefit and I'm also not confident abt my Ajax coding ability. Thanks again.


author: Confluence Man
body: Hi Vivek,

I had a table that served as a 'Summary' of a process on many pages. I took this table and created a single table that provided an overview of all processes in confluence based on this table.

This was a single table on a process page:

```
Last Review Date: 01-01-2016Process Owner: MeProcess Support: YouCritical: YesStakeholder: Some External Dude
```

That was transformed into the below on my Summary table:

```
Process Name | Critical | Owner | Support | Stakeholder | Review DateProcess X | Yes | Me | You | Some External Dude | 01-01-2016--- more rows
```

It was a PITA to do tbh because I had to learn various bits and pieces to pull it off but it was effectively:

1. Create process overview page with a single empty table
2. Create a user-macro for the 'Summary' table that will:
   1. Take user input for various fields
   2. Pull the table from the 'Process Overview' using AJAX, check the values for changes using jQuery, update or insert into html if not already in table
   3. Push this new table back onto the 'Process Overview' page

I also need to make a method to update the 'Process Overview' page from a click rather than having to load each process page individually.

But this meant that any changes were instantly updated on the page and did not require a huge amount of overhead to perform this.

Hope that's helpful.


author: Vivek Rao
body: Have you found a solution? Ideally, it should be like choosing which pages to print from a document (e.g., 1, 3-5, or all).


author: Confluence Man
body: You sound like you're trying to perform magic, like me haha. I am trying to perform something very similar to this.

First question, do you have multiple excerpts on the same page? If so, you will need to either use the multi-excerpt addon or get hands dirty with user macros. (All this does is remove the heavy lifting, you will still need a user macro to create the bigger table you want but you can probably do in jQuery in a couple lines to be honest, assuming they have the same columns).

If it is a single excerpt on a multiple pages then you can pull them in using an excerpt-include and then jQuery/javascript your table from the results.  
If it is multiple excerpts on a page then maybe forget about the excerpt macro and make a macro to add classes or ID's to your excerpt information (something like:

```
## Body processing: Rendered## @param class:title=Class|type=string|required=true|desc=The class(es) you want to add$body&lt;script&gt;$("table").last().addClass("$paramclass");&lt;/script&gt;
```

<br />

What I am currently using to add classes to confluence tables).

Then on your table page, pull the information from the pages and display how you want.  
My only issue with this method is that, hypothetically, if you have 1000's of pages, how long would it take to pull and parse all the information? My alternative that I am exploring now is to instead update the table page from the excerpt page whenever they are loaded rather than trying to pull all the data.

This method would, onLoad, check if the excerpt is on the table page, if it is update values otherwise create new row. Currently, I am trying to figure out how to POST to a page without having to put user credentials in the user macro.

If you find any charms, incantations or pixie dust to help with this, I'd appreciate you throwing some my way.


author: Bill Bailey
body: I know of no way to do this. You would need a macro that sits inside the source -- and no way I know to do that. So I would say impossible.


Tags: confluence-administration

confluence-cloud

multi-excerpt-macro

questions-for-confluence