projectdoc toolbox / Display table
Asked by Rajesh Prabhakaran:

Hello,

I have a list of pages where I have used Document Properties Marker. [Document Properties Marker Macro (smartics.eu)](https://www.smartics.eu/confluence/display/PDAC1/Document+Properties+Marker+Macro)

The name (Title) of the pages are AID-1, AID-2, AID-3 and so on.

I have used display Table Macro to consolidate display all the pages in one page.

[Display Table Macro (smartics.eu)](https://www.smartics.eu/confluence/display/PDAC1/Display+Table+Macro)

**Problem Statement**

* I am unable to sort these pages in ascending or descending order. There is a sort option but it just doesn't work. I am not able to understand the formula that the project doc team has asked to use - I am a complete newbie in this space, please help me.
* There is a page properties called **Flag** with two status in it - 'Yes' \& 'No'. When I try to filter on these status to reflect only the pages with *Yes* Flag, I receive the below message: *The query matched no documents.* Which is incorrect as there are pages with *Yes*flag.

Many thanks in advance,  
Raj


Answers:
author: Robert Reiner _smartics_
body: Hi Rajesh,

The properties to use for sorting are defined in the Document Properties Macro. For instance Name and Flags (mind the "s" since in your example you write "Flag"), but also artificial properties like the Title. You may add any property (so maybe the "Flag" property from your example is indeed your own defined property?).

The Display Table Macro has a parameter "Sort By" where you can specify the properties to use for sorting. For instance

Flags, Name

Would sort the documents according to the value of Flags and if the value of Flags is equals, checks the sort order by the Name values, both ascending.

Filtering is done with the Where parameter of the Display Table Macro. In case you would like to filter the result list for all where Flags has a value of Yes and then sort by by the Subject and then by the Name property then this would be configuration of the Display Table Macro:  

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/246941i97D620CA3792861B/image-size/large?v=v2&px=999 "image.png")

The Where parameter syntax is actually something we need to improve. It basically say: Make an exact match query where one of the Flags values (may be a comma-separated list of values) matches the string "Yes". There is also an page in the online manual that provides some tips on how to use the search function: [Search Tips (https://www.smartics.eu/confluence/x/dAVk)](https://www.smartics.eu/confluence/x/dAVk)

Sometimes there is an issue if the property value is copy-pasted and contains some HTML code. This is mainly the case when the value is displayed (e.g. has some extra spacing because there is a paragraph tag around the value). So in case there are issues you may first want to check if the source is "cleared from extra HTML code" using the source editor (<https://marketplace.atlassian.com/apps/1210722/confluence-source-editor>).

Note that sorting on multi-valued properties may not work as expected, since the values are taken literally. So if one document has the value "One, Two" and the other "Three, One" for Flags, the sorting is based on the entered character sequence, not the individual values. Therefore we recommend to do sorting only on properties that have only one value.

In case this answer does not actually resolve your issue, you may like to share your use case (definition of properties, configuration of the Display Table Macro parameters) so we could make it work together?

Please get in touch in case you have further questions!  

Cheers,  
Robert


Tags: projectdoc

smartics