Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Add Excel-like filters to table in Confluence

Sam
Contributor
January 27, 2020

How would I create filters on a Confluence table that act like filters in Excel do? For instance, I would like to make small buttons appear on the topmost cells of each column that, when clicked on, would show a text box. For example, if someone typed "asdf" in that text box, the table would then hide rows that don't have that text in that column.

CustomerSystemEnvironment

AiDeliveryProd
AiMirthDev
DresnerDeliveryDev

3 answers

0 votes
A C
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 9, 2020

Hi, I need a macro that filters not all columns, but one column.
Will you help in this matter?

0 votes
Rahul Savaikar
Contributor
June 24, 2020

Hello @Sam ,

Please try this method of creating a user macro.

https://community.atlassian.com/t5/Confluence-articles/The-Admin-s-tale-User-Macro-filtering-a-Confluence-table/ba-p/459369

It has worked for me for quite some time.

 

Procedure:
1. Go to http://host:port/admin/usermacros.action
2. Click on "Create a User Macro"
3. Macro Name: filter-all-tables
4. Visibility: Visible to all users in the Macro Browser
5. Macro Title: Filter all tables (This text will help you search the macro)
6. Categories: Confluence content
7. Macro content


## Macro Name: filter-all-tables
## Macro Title: Filter all tables
## Category: Confluence Content
## Macro has a body: N
## Body processing: None
##
## Source: https://community.atlassian.com/t5/Confluence-articles/The-Admin-s-tale-User-Macro-filtering-a-Confluence-table/ba-p/459369
## Date created: 2018-02-26

## @param FilterID:title=FilterID|type=string|required=true|desc=ID [a-z,A-Z,0-9]
## @param Label:title=Label|type=string|required=true|desc=Label
## @param Class:title=Length of the input field|type=enum|enumValues=short-field,medium-field,medium-long-field,long-field,full-width-field|default=long-field
## @param ColumnNumber:title=Column Number|type=string|required=true|default=-1|desc=Specify the column number or "-1" for the entire row

<form class="aui">
<input class="text $param0" type="text" id="searchInput" placeholder="Filter all tables (case insensitive)">
</form>

<script type="text/javascript">
AJS.$("#searchInput").keyup(function () {
var jqry = AJS.$
var rows = jqry("tr").hide();
var searchData = this.value;
if (searchData.length) {
## This change will allow single word search only
var data = searchData.toLowerCase().split(" ");
## This change will allow multi word search
## var data = searchData.toLowerCase();
jqry.each(data, function (search_idx, str) {
rows.filter(function(row) {
return $(this).text().toLowerCase().indexOf(data) >= 0;
}).show();
});
} else rows.show();
AJS.$('thead tr').show();
});
</script>

 

0 votes
Jaclyn Mazzarella
Atlassian Partner
January 27, 2020

Hello, I know that standard Confluence tables do not allow for filtering of that kind. To perform the level of filtering you want, you will have to download an app/macro.

By downloading an app called Excellentable, you are able to perform Excel-like functions without leaving Confluence and ridding the need to use standard tables. Specifically, the feature in Excellentable that can solve your issues above is view & edit mode filters. Hope this helps! 

Like # people like this
Sam
Contributor
January 27, 2020

Hi Jaclyn, thank you for responding so quickly! I'm looking for a way to do this with a macro and no apps. Could you help me find a solution without apps?

Jaclyn Mazzarella
Atlassian Partner
January 27, 2020

Hello, no problem! Unfortunately, there is no way, that I am aware of, to filter out-of-the-box Confluence tables without an app installed on your Confluence instance. 

Sam
Contributor
January 27, 2020

Do you think you could escalate this ticket to someone who might know a way to do that?

Rahul Savaikar
Contributor
June 24, 2020

posted as answer

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events