It looks like you’re mixing two different ways of working with Handlebars here.
In your template, you’re trying to define a custom helper using <script>Handlebars.registerHelper(...)</script>, which would work in a browser-based setup where you’re rendering everything client-side. But in MindStudio, templates are rendered server-side, so any <script> tags or helper definitions in the template itself can’t run or be recognized.
Instead, you can use our built-in sample helper, which is designed exactly for this kind of thing. It lets you extract a portion of a string by word, line, or letter:
{{sample content 300 "letter"}}
Or, if you’d rather sample by words:
{{sample content 50 "word"}}
This should give you a clean, truncated summary without needing to define your own helper.
If you wanted to go deeper, a more advanced way of doing things would be to use a custom function to get all the variables in order before rendering the template, which is how I usually do it because it makes the final Generate Asset step a lot cleaner, since all you’re doing is plugging in variables instead of mixing logic/transformations in as well.
However, when I include the sample helper, the Live Preview doesn’t render as expected. In fact, if the form is long and includes other variables, nothing renders at all - including plain variables.
Interestingly, when I run the workflow itself, the Generate Asset block works fine and returns the expected result (e.g., the first 10 characters). It seems the issue is limited to the preview function.