filtering text in a report based on list-option value

  • 1
  • Question
  • Updated 2 years ago
I'm a new user of Scaffolding and Reporting. Prior users at my site set up a system for project management where each project has its own child page containing text-data and list-data, and fields are summarised in a table on the parent page using content-reporter. This works well.

I have been able to filter the report table using values from text-data successfully, but I'd now like to filter the table using values from list-data.

Specifically, I'm trying to do:
Report Table
Content Reporter
Text Filter | data:listdataname
various Report Column macros, each containing a Report Info macro
Structuring my Text Filter like this results in a table containing no values, so it seems I'm not accessing the data:listdataname correctly - even though I am able to use this same key in other parts of the table to just print the value (using a Report Info | data:listdataname macro).

Can anyone offer some advice for how I can filter a report on a list option value, please? Thank you!
Photo of Kelly Atkinson

Kelly Atkinson

  • 2 Posts
  • 1 Reply Like

Posted 2 years ago

  • 1
Photo of Kathryn Moye

Kathryn Moye

  • 223 Posts
  • 12 Reply Likes
The list data macro outputs values as if in an array.  So if a list data value of "Apple" was picked in the list and you want to use a filter on it, the actual output from list-data is [Apple].  So you either have to use reg ex in the include parameter of the text-filter with .*Apple.* or put [Apple] in the Exact parameter.  You can also use the collection supplier's "first" parameter to get rid of the brackets by key chaining:  data:listdataname>first
In very recent releases this behavior seems to be different in that the square brackets are no longer in the output.
So, your text-filter would look like
Text Filter | data:listdataname>first
OR
Include .*Apple.*
OR
Exact [Apple]

Apple being the work you are trying to match from the list data.

Hope this helps!
Katy
Photo of Kelly Atkinson

Kelly Atkinson

  • 2 Posts
  • 1 Reply Like
Thanks, Katy - this worked perfectly!