Suppress template text if no rule input data

Certified Associate Developer

I have created a form that collects data, i.e Water Usage, Gas Usage, Electrical Usage.  So I need to create a report that only displays the sections that have actual data from the form.  So if there is no Gas for example, that section of the report template would be suppressed.

Thoughs?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    as addition to stefans reply (regards by the way)

    you can check for "empty" values with the isnull() function.
    example:  (please replace "label" with you actual label string and local!value with you actual local or rule input)

    textfield(
        label: "label"
        value: local!value
        saveInto: local!value
        showWhen: not(isnull(local!value))
    
        ....
    
    )
    
    /* isnull() = true -> there is no value,    isnull()=false, there is a value */

  • 0
    Certified Associate Developer
    in reply to Richard Michaelis

    Sorry I was not clearer.

    Let me see if this helps.  I have created an interface for data collection and some of the ruleInputs will have values and some will not:

    ri!waterSavings ($100.00)

    ri!powerSavings null

    ri!gasSavings ($50.00)

    So on my Word template it might be something like attached, but I would want to suppress and text where the ri! might be null, in this

    I would want the word "Power" to not show at all.

    test.docx

Reply
  • 0
    Certified Associate Developer
    in reply to Richard Michaelis

    Sorry I was not clearer.

    Let me see if this helps.  I have created an interface for data collection and some of the ruleInputs will have values and some will not:

    ri!waterSavings ($100.00)

    ri!powerSavings null

    ri!gasSavings ($50.00)

    So on my Word template it might be something like attached, but I would want to suppress and text where the ri! might be null, in this

    I would want the word "Power" to not show at all.

    test.docx

Children