---
title: "spaces-report macro"
canonical: "https://support.appfire.com/space/COMALACM/656579293/spaces-report%20macro"
format: markdown
---
> Macro (aura-html)

## <span style="color: #091e42">Overview</span>

<span style="color: #091e42">The </span>`spaces-report`<span style="color: #091e42"> macro</span><span style="color: #333333"> lets you generate a report detailing multiple space metadata attached to the matching spaces.</span>

<span style="color: #091e42">Any metadata created with the Comala Metadata app </span>[space-metadata](https://appfire.atlassian.net/wiki/spaces/COMALACM/pages/656578849) and the<span style="color: #091e42"> </span>[space-metadata-list](https://appfire.atlassian.net/wiki/spaces/COMALACM/pages/655890257)<span style="color: #091e42"> macros can be displayed in the report. </span>

<span style="color: #091e42">The macro can also retrieve values for any Confluence </span><span style="color: #091e42">[internal space metadata](https://appfire.atlassian.net/wiki/spaces/COMALACM/pages/656578765)</span><span style="color: #091e42">, such as </span>`Space,`<span style="color: #091e42"> alongside custom metadata created with the app.</span>

## Parameters

| Parameter | Required | Default | Notes | Version |
| --- | --- | --- | --- | --- |
| `Fields` | :check_mark: |  | <span style="color: #000000">The list of fields (columns) to be included in the report. This can include added metadata and internal metadata.</span> |  |
| `sort` |  | `modified` | <span style="color: #000000">Specifies which column in the report should be sorted by.</span><br><span style="color: #000000">You can also include a hint for the sort method before the sort direction.</span><br><span style="color: #000000">For example, "Name as istring asc" or "Name as istring" applies a case-insensitive comparison, considering values as strings.</span><br><span style="color: #000000">Other choices include </span><br>- <span style="color: #000000">"as date"</span>
- <span style="color: #000000">"as number"</span>
- <span style="color: #000000">"as string" (case-sensitive)</span><br>> ℹ️ <span style="color: #000000">Default is case-insensitive comparison.</span> |  |
| `maxResults` |  |  | <span style="color: #091e42">Specifies the maximum number of results in a report.</span><br>- <span style="color: #091e42">The default is 500</span> |  |

## Usage

> Macro (excerpt)
> 
> To retrieve multiple metadata values from spaces in the instance
> 
> - Choose the **Spaces Metadata Report **macro from the Confluence macro browser:
> 
> ![image](media://d5393767-3f6d-450a-8a35-2897f029860e)
> 
> The macro editor lets you configure the macro before adding the macro to the page. At least one metadata name is required. 
> 
> ![image](media://656d1735-3ba1-4e01-a919-dc5f86098cef)
> 
> For each space with none of the specified metadata, the report displays an empty row.
> 
> If required, simply `sort` on an appropriate column and set maxResults to only show the spaces with a value for the attached space metadata.
> 
> > ℹ️ A null value in the report may indicate that no metadata name is attached rather than a null value for the metadata value for the space.
> 
> In the example, three spaces have space metadata attached - with the results sorted on one column and results restricted:
> 
> ![image](media://25458b33-ec5b-4430-b16a-6185ad0bd8ca)
> 
> No content can be added to the macro placeholder. The report displays the space metadata and values in a tabular format.
> 
> ![image](media://3dfb891b-7388-43ac-bc52-4bedccc04040)
> 
> - The name of the space is displayed using the `Space` internal metadata
> - `Galaxy Base`, `G-Type,` and `Lead Commander` are all space metadata created using the Comala Metadata app
> - The table column order depends on the order of the fields entered using the macro editor

## Reference Markup

```
{spaces-report:Space,Owner,Purpose,Galaxy Base, Lead Commander, Last Time Changed|sort=Owner desc|maxResults=4}
```

The example above displays the following report:

![image](media://e50503b8-d91e-4819-870e-f479a676afbd)

The sort and maxResults have been chosen so only spaces with the added space metadata `Owner`, `Purpose`, `Galaxy Base,` and `Lead Commander` are shown on the page with the [internal metadata](https://appfire.atlassian.net/wiki/spaces/COMALACM/pages/656578765) `Space` and `LastTimeChanged`.

## Usage with the Comala Document Management app

The `spaces-report` macro is** supported** by the Comala Document Management app and works at the workflow level.

```
{spaces-report:Space,User,metpiece|maxResults=4}
```

## Related macros

> Macro (contentbylabel)

## Related documentation

- [Adding metadata to spaces](https://appfire.atlassian.net/wiki/spaces/COMALACM/pages/655988362)
- [Retrieving and displaying space metadata](https://appfire.atlassian.net/wiki/spaces/COMALACM/pages/655758622)
- [Using metadata in a space](https://appfire.atlassian.net/wiki/spaces/COMALACM/pages/655758361)