I created a custom button with a microflow on a form holding different documents. In the microflow:
- Create object on the custom table holding the documents and having a generalization on FileDocument
- Change object to fill the required fields and to relate it to the parent table
- Generate document function to create a word document
- Download file function to download the document.