List labels by exclude other labels

Scenario

This recipe is to list the labels from pages by excluding other labels. There is a situation where there are uncategorized labels that keep changing while those that are categorized are not. With the uncategorized labels are added more frequently, it is hard to find them all. Hence, by excluding the labels categories that are not changing, we can quickly get the ones that keep changing.


Result


Recipe

Ingredients

Storage format

Macro structure

You can recreate the example in the editor view:

Steps

  1. Add a Report List macro.
  2. Inside it, add a Grouping Reporter and a Report Body macro.
  3. For the Grouping Reporter macro, set the following settings:
    Key = expanded:myLabel
    As = myUniqueLabel
  4. Inside the Grouping Reporter macro, add the following macro with the settings:
    1. Expanding Reporter macro
      Key = content:labels
      As = myLabel
    2. Text Filter macro
      Key = grouped:myUniqueLabel
      Exclude = add the excluded labels here with 'pipe' as the separator, for example, lab1|lab2|lab3
    3. (info) If there is another label category that needs to be excluded, add another Text Filter macro.
  5. Then, inside the Expanding Reporter macro above, add the following macro with the settings:
    1. Content Reporter macro
    2. Text Filter macro
      Key = label:title
  6. Navigate to the Report Body macro that is created alongside the Grouping Reporter macro, add the following macro inside it:
    1. Report Info macro
      Key = grouped:myUniqueLabel
      Link to item = enabled