Skip to main content
February 7, 2024
Question

Docx from Dynamic template

  • February 7, 2024
  • 15 replies
  • 0 views

hi i want to create a template and xml data model for Docx from dynamic template. how to code that. and how to create the template. can i get an idea? 

it should be like letter. 

    15 replies

    konduruc733182
    February 7, 2024

    Hello [mention:50db1cd8fb304dd499245322b8cbac67:e9ed411860ed4f2ba0265705b8793d05] 

    We can show some Ideas only if you give us more information.
    1. What is the content? 

    2. Will it contains tables or any other images?

    3.Does it have any dynamic content?

    4. What are the fields that will change or update dynamically?

    February 7, 2024

    It should be like this. all the names, address, mobile number all those should be dynamic values. I want know how to config template and xml model for them

    konduruc733182
    February 7, 2024

    Your Word Template would look something in this way

    Do not want to provide the actual file since it would only affect your learning.

    You will have to pass the data using the varable. Your values in the doc will be defined in this format doc.VariableName.field .

    you will need to construct the data in a expression rule in the below format (Example). Please refer and write your own expression.

    = "" & 
    "" & text(ri!letter.date,"yyyy-mm-dd") & "" & 
    "" & ri!letter.name"" &
    /*other fields in a non ultiple variable*/
    
    a!forEach(
      items: ri!names/*Variable that contains the list of data in the Table*/,
      expression: ""
    ) & ""

    Please do more research on how to write XML and DOCX template which would help you explore more ways of creating a dynamic doc

    abhayd3663
    February 7, 2024
    February 8, 2024

    no my task is to use Docx from dynamic template

    ashwinia3199
    February 8, 2024

    Hello,

    Please refer screenshot insert all your tags.

    insert--> Field --> Merge field

    Then only tags gets replace.