Single category headers in workflow templates for multiple records of same category

Say you have data like this:
image

With “Group by” selection in a Table view, you can easily display this in the app like so:
image

But what if you want to do so in a PDF file generated via a START expression in a workflow?
Use the following general model:
image
Which basically says “if this is the first item in this category, display a header”.

The tricky part is when using a subset of values in a table, like child values of the parent record you’re working with. Then for the second blue section, you’ll need to FILTER the whole table by a ref column, which requires the use of a _THISROW statement, and they work kind of funky inside START expressions in workflows. You’ll probably need to use _THISROW-1. Don’t really want to get into that here, but just didn’t feel like this Tip was complete without mentioning the issue.

11 Likes

Outer <<Start>> tag:

<<Start: ORDERBY(FILTER("table", ([_ROWNUMBER] = MIN(SELECT(table[_ROWNUMBER], ([_THISROW-1].[category] = [category]))))), [category])>>

Inner <<Start>> tag:

<<Start: FILTER("table", ([_THISROW-1].[category] = [category]))>>
8 Likes

SteveSteve Coile
The solution given is very useful ,

Can we have the workflow template for the Report (file attached) for the data(file attached)!
i hv used
<<Start: ORDERBY(FILTER(“SLICE_D”, ([_ROWNUMBER] = MIN(SELECT(SLICE_D [_ROWNUMBER], ([_THISROW-1].[NAME] = [NAME])))))+FILTER("SLICE_C ", ([_ROWNUMBER] = MIN(SELECT(SLICE_C [_ROWNUMBER], ([_THISROW-1].[ ACCNT] = [ACCNT]))))), [NAME])>>

<<[ NAME]>>
for the header
and
<<Start: FILTER(SLICE_D, [NAME]=[_THISROW-1].[ NAME])+FILTER(SLICE_C, [ACCNT]=[_THISROW-1].[ NAME])>><<[UNIQUEID]>>
DATE<<[DATE]>>
PRT<<[PRT]>>
NAME_D <<IF(IN([_THISROW-1].[UNIQUEID],SELECT(SLICE_D[UNIQUEID],[ NAME]=[_THISROW-1].[ NAME]))=TRUE,[UNIQUEID].[ NAME_D
],””)>>
ACCNT_C <>

<>
file link copied

https://docs.google.com/spreadsheets/d/1UXA-zlVrFN0l1lhJuaOsj7Nywth44T5JXdXC8A45nFc/edit?usp=sharing
Name_Report|400x387 DATA

Name_Report