I have a document generation use case in Appian where I maintain a Request table and a separate Letter table that supports multiple versions of documents per request. For each letter version, I store selected template components such as header and footer (single selection) and multiple paragraphs, which are mapped through a separate association table to maintain order. These templates are stored in reference tables and contain placeholders in the format [placeholderName], which can appear anywhere within the text. In the first task, users select the required header, footer, paragraphs, and optional sections like privacy policy or guarantee content, and those selections are saved against the letter record. In the second task, based on the selected template content, I combine all the text and for each placeholder I need to fetch values from different data sources (for example, customer name from a customer table, address from another table, sender details from a user table, etc.), present those values in dropdowns for user selection, and use the selected values to populate a preview as well as generate the final document. Additionally, the system must support multilingual functionality where both predefined template content and generated documents should be available in different languages (currently French and Spanish), based on user choice, while maintaining the same placeholder structure across languages.
I am confused by how to extract and map the placeholder with values from correct source tables and find and replace them in the document. Can anyone help? I'm thinking maintaining separate table or add a one more column in the reference table for placeholder if the sentences contains palce holder that can be added in separate column. But still finding the place holder and replaceing it will actually values for user to update and replaceing it in documents I need some idea or help
Discussion posts and replies are publicly visible