---
title: "Extract child page counter numbers from page titles"
canonical: "https://support.appfire.com/space/REPS/472916603/Extract%20child%20page%20counter%20numbers%20from%20page%20titles"
format: markdown
---
> Macro (aura-html)

## Scenario

The [Add page macro](https://appfire.atlassian.net/wiki/spaces/LINS/pages/471893884) (part of the [Linking app](https://appfire.atlassian.net/wiki/spaces/LINS)) can automatically generate pages with incremental numbers in the titles, for example, *Incident Report 001*, *Incident Report 002*, *Incident Report 003*, and so on.

## Result

This example recipe will generate such pages.

![image](media://edeb9b7c-cd52-417b-8355-cd3e41684666)

You can also inject the incrementing numbers into each generated page. For example, you can have a *Report Number* field, and it can contain the same three-digit number from the title:

**Report Number:** 001  
**Report Number:** 002  
**Report Number:** 003 and so on

This recipe will automatically create pages with incrementing numbers, along with matching number fields in the pages.

![image](media://557e8cfc-a5d9-436f-b046-80f671cf772f)

## Recipe

| Apps | Reporting for Confluence Data Center, Linking for Confluence Data Center |
| --- | --- |
| Level | Intermediate |
| Estimated time | 25 minutes |
| Macros | Report Info, Report Variable |
| Suppliers | Child Counter Supplier |

## Storage format

You can copy and paste this code into the [Confluence Source Editor](https://appfire.atlassian.net/wiki/spaces/REPS/pages/472907841):

```

<p>
  <ac:structured-macro ac:macro-id="1ecd3808-f211-433c-8993-552ccfd14884" ac:name="add-page" ac:schema-version="1">
    <ac:parameter ac:name="name">Incident Report %child-counter:next &gt; number:000%</ac:parameter>
    <ac:parameter ac:name="linkText">Create a new incident report</ac:parameter>
    <ac:parameter ac:name="source">Incident Report Template</ac:parameter>
  </ac:structured-macro>
</p>
<p>
  <ac:structured-macro ac:macro-id="46068b0f-91dd-4927-aa7d-38e2b74e50ee" ac:name="children" ac:schema-version="2">
    <ac:parameter ac:name="sort">title</ac:parameter>
  </ac:structured-macro>
</p>

```

## Steps

1. Create a landing page by using the storage format code above, and provide a suitable name, such as `Incident Report Main Page`.
2. Create a template file for incident reports. This file is loaded whenever a user clicks the *Generate an incident report* link. You can copy and paste the code below for your template file with the [Confluence Source Editor](https://appfire.atlassian.net/wiki/spaces/REPS/pages/472907841):
3. Save the file and provide a suitable name, such as `Incident Report Template`. You can either save it as a template (requires space administrator privileges) or as just a standard Confluence page.
4. After you have created and saved the template, you can reference it from the Add Page** **macro used for the landing page. Edit the landing page and the Add Page macro within it.
5. In the *Edit 'Add Page' Macro* dialog, enter or paste the template page name under **Source**, and select either **template **or **page **under **Source Type,** depending on what you used in the earlier step.
6. Click **Save**, then click **Save** again to save the landing page.

The landing page is now available to users.