Generate document with dynamic table in it

Hi,

I have to create a document(it could be any type) with dynamic table in it. is there a way to achieve this without using any other shared component/plug-in ?

Thanks in advance.

  Discussion posts and replies are publicly visible

  • Yeah you can achieve so by using the smart service Text doc from template available under Document Generation Appian smart services . For dynamic table you need to generate an html code in your process and pass that html code in the document. In the template you will need to accordingly use ###tag### to display dynamic data received from the process.
  • I am able to do it from "HTML Doc from Template" smart service but unable through text doc. Could you please share the final pv value, how it should be and template document to achieve this "Text doc from template" smart service.
  • Hello I am not sure I understood your question what you mean by saying "without using any other shared component/plug-in".

    From previous answers i think you are able to use the plugin "Dynamic document Generation" (community.appian.com/.../dynamic-document-generator)

    If not that will be really difficult, but i understand you are able to, so It always depends what you mean by "Dynamic table".
    Using the same smart service suggested by Harsha you can generate txt, csv, html, xml, based on a expression rule.

    the file should be like this
    --------template.txt-----
    ###tag###
    -------------------------------
    NOTE: the extension you give to the template will be the same extension you will get in the generated file.

    When selecting the template choose this file, and scan the variables, then the template will give you the option to pass any expression ,can be any string you generate or the output of any rule, i recommend to put all the logic in the rule so the logic is easy to write, test and debug.

    NOTE: if you file is large try not to store the value in a pv!variable, because your process will be storing that, and try to delete the process instances as soon as possible.

    i hope this helps, if you need a word or pdf then that is another story.

    Jose Perez
  • Thanks Jose for your reply. Question is, is it possible to generate dynamic table(number of rows are not fix and it depends on user input) in the document. i do not want use any other plug in than Appian provided in document generation. As Harsha said, its possible by "Text doc from template" but Im not able to do it. @Harsha, could you please share me sample input for that smart service and template format.
  • Hi annap, This is the template that I am using. Template.rtf. It is having ###studentTable### as the only data in it.

    Now in the process model using script tasks and MNI through the PV I have created a html table code as : <table border='1'><tr><th>Name</th><th>Department</th><th>Experience</th></tr><tr><td>John</td><td>Accounts</td><td>3 years</td></tr><tr><td>Philip</td><td>HR</td><td>5 years</td></tr><tr><td>Adam</td><td>Networking Services</td><td>2 years</td></tr></table>.

    Now in the Text to document Node this is the configuration that I have done:

    As you can see the template is scanned by this smart service and studentTable variable which was within ### in the document is asking for a value where I am assigning the studentDetails text corresponding to HTML.

    After running the process this is the generated document that I am getting : Generated Doc.rtf.

    Hope it helps.

  • Thanks Harsha, Its done. I was making mistake in template extension.
  • 0
    A Score Level 2
    in reply to Harsha
    Hi Harsha,

    How can I convert this GeneratedDoc.rtf to PDF?
    Do we have any plugin other than Advanced Document Template?
  • 0
    Certified Senior Developer
    in reply to Harsha

    Hi Harsha,

    Will you please explain that how to do it in script task when the row values are dynamic ..

    <td>John</td><td>Accounts</td><td>3 years</td></tr><tr><td>Philip</td><td>HR</td><td>5 years</td></tr><tr><td>Adam</td><td>Networking Services</td><td>2 years</td></tr> 

     In these lines, values(like 5 years, Adam)  are passed default...

    But how to pass it dynamic based on no of rows and values in each row which I had in pv