General Discussion

 View Only
  • 1.  Handlebars - showing a table or paragraph under conditions

    Adopter
    Posted 09-18-2023 08:38

    Hello,

    Does someone have more experience with making tables or paragraphs visible or hidden (on a pdf output document) when using Handlebars?

    I did found following in the documentation :

    But when using this is my output document I does not works.

    In following example I only want to show the table when question B1 is NOT equal to "-".

    Some suggestions?

    Thank you,

    Peter



    ------------------------------
    Peter Dienaar
    PF developer
    Johnson Controls
    ------------------------------


  • 2.  RE: Handlebars - showing a table or paragraph under conditions
    Best Answer

    Staff
    Posted 09-18-2023 11:12

    Hi Peter,

    There is a small part that is missing in your code, plus some organization that will be needed. Your code should look something more like this:

    {{#pf:if answers.B1.[0] "!is" "-"}}

        <tr>
            <td class = "auto-style11">

                <pre>{{answers.B1.[0]}}</pre>

            </td>

        </tr>

    {{/pf:if}}

    In the following document, it explains the supported operators. In your case, you used the "is" operator, but you needed the "!is" or "not is", operator. 

    https://docs.prontoforms.com/1374411/Content/Published/360000634103.html

    As I am sure you are aware, we also have a Professional Services team that is well versed in custom document creation. You can engage with us to quickly rectify these issues along with you. We can help answer questions, provide example code for you to use, or fully build documents to ensure you maintain timelines.

    I hope this helps!

    Ryan



    ------------------------------
    Ryan Maxwell
    Lead, Rapid Deployment
    ProntoForms
    ------------------------------



  • 3.  RE: Handlebars - showing a table or paragraph under conditions

    Adopter
    Posted 09-19-2023 03:28

    Thank you Ryan ! Now it works !

    Peter



    ------------------------------
    Peter Dienaar
    PF developer
    Johnson Controls
    ------------------------------



Reminder: Content posted to our Community is public content.  Please be careful not to post Intellectual Property that you do not have permission to share.  For more information please refer to our Terms Of Use