I guess this relates a bit to how you structure data to use the mail merge or even document generation. I’ve recently helped a customer to go from multi-row to single-row in their data structure to be able to use doc generation.
A couple of =QUERY()
and =ARRAYFORMULA()
can solve this