Skip to main content
Skip table of contents

How to use a PocketQuery macro inside a Page Properties macro

Solution

Integrating PocketQuery results into a Page Properties Macro doesn't work as expected. The reason is that while the content may look similar to the users eye, technically there is a huge difference. See the explanation below for further details.

The simplest workaround is to simply put the PocketQuery macro inside another simple table with only one column. This way the Page Properties macro is able to find a table in its body and will use the data provided by the PocketQuery macro for the Page Properties report.

Explanation

Usual case

Normally you simply put a table inside the Page Properties macro. The macro then searches inside its body for this table and extracts the information within. Let's see an example:

The storage format of this section looks like as follows. Notice how there is a <table> inside the <ac:rich-text-body>. This is what the Page Properties macro is looking for.

CODE
<ac:structured-macro ac:name="details" ac:schema-version="1" ac:macro-id="7e489b5a-8046-4cb9-a183-c1bc8707a610">
  <ac:rich-text-body>
    <table>
      <colgroup>
        <col />
        <col />
      </colgroup>
      <tbody>
        <tr>
          <th>first column</th>
          <th>second column</th>
        </tr>
        <tr>
          <td>some data</td>
          <td>even more data</td>
        </tr>
      </tbody>
    </table>
  </ac:rich-text-body>
</ac:structured-macro>

With PocketQuery

Now let's put a PocketQuery macro (or any macro for that matter) inside the page properties, like this:

CODE
<ac:structured-macro ac:name="details" ac:schema-version="1" ac:macro-id="7e489b5a-8046-4cb9-a183-c1bc8707a610">
  <ac:rich-text-body>
    <p>
      <ac:structured-macro ac:name="pocketquery" ac:schema-version="1" ac:macro-id="75a17d82-a3cc-4425-bab9-907613d4ceae">
        <ac:parameter ac:name="name">all-content</ac:parameter>
      </ac:structured-macro>
    </p>
  </ac:rich-text-body>
</ac:structured-macro>

Notice how there now is no <table> inside the <ac:richt-text-body> of the Page Properties macro anymore. So when looking for a table the Page Properties macro can't find any. Therefore the report will be empty.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.