Split page titles containing hyphens into separate values

Scenario

This recipe shows you how to split page titles containing hyphens into separate values and using them in separate columns of a table. 

For example, you have many pages and the title of the page has the following format:

"Meeting-ID - Meeting-Title"

For example:

  • 12345 - Meeting with NASA
  • 23456 - Meeting with Dolby
  • 34567 - Meeting with Atlassian

With the use of the Collection Supplier and Text Supplier, you can split the page titles with hyphens to break the Meeting ID and Meeting title into two different columns. 


Result


Recipe

Ingredients

Storage format

Macro structure

You can recreate the example in the editor view:

Steps

  1. Create a Report Table macro.

  2. Within Report Table macro, create a Content Reporter macro.

  3. For Content Reporter macro, set the following parameters:
    Types: page
    Scope: Meeting Notes > Children

  4. Within Content Reporter macro, create a Text Sort macro and insert "title" in Key parameter.

  5. Within Report Table macro, under Content Reporter macro, create four Report Column macro.

  6. Set the first Report Column macro's Title to "Meeting ID" and add a Report Info macro within it.
    Set the Report Info macro's Key to "content:title > text:split with - > collection:1".

  7. Set the second Report Column macro's Title to "Meeting Title" and add a Report Info macro within it.
    Set the Report Info macro's Key to "content:title > text:split with - > collection:2".
    Tick Link To Item.

  8. Set the third Report Column macro's Title to "Created Date" and add a Report Info macro within it.
    Set the Report Info macro's Key to "content:creation date > yyyy-MM-dd".

  9. Set the forth Report Column macro's Title to "Creator" and add a Report Info macro within it.
    Set the Report Info macro's Key to "content:creator > full name".