Hi @pete31,
Really appreciate your offer to take another look at this. Even though a smart rule would be the ultimate solution for minimizing maintenance, a triggered script would certainly help a lot to further streamline things compared to my current workaround.
Quick clarification regarding the previous request to “include the heading” to ensure that if we’re ruling out a smart rule script, we’re doing so based on the same understanding of the objective:
What I meant to write here is actually that I want to include the title of the record as a formatted heading (##) in front of the record’s content in the transclusion document. So the end result would ideally be:
- (##) Record A title (linebreak) Record A content
- (two line breaks)
- (##) Record B title (linebreak) Record B content
- etc
It would be surprising to me if a smart rule could access a record’s contents but not its title. However, there may just be things about the mechanics of scripting in DT that I don’t yet understand. And again, a triggered script would be great as well otherwise!
One thing that would be important is that the script either needs to respect the visible order of items, or it needs to be possible to specify the field, by which records should be ordered in the transclusion. For my use case, I would want them to be ordered by a custom field that I created to group related items.
As a bonus, nice-to-have addition, another thought:
I noticed that the current version of the triggered script only creates a new transclusion, if none has already been created in the respective group. From my perspective, if it is feasible, an automatic replacement of the transclusion would be ideal. This way, the group would always contain the most up-to-date version including new Markdown items that were added into the group. Currently, one would need to check for each group whether it already contains a transclusion and delete it, before triggering the script. With this change, this additional step would no longer be needed.