PDF Templates render before variable substitution

Hi all,

I am creating a PDF template but would like to change format dynamically, the case is, I want to remove a

  • entry when a condition happens.
    I can create a variable that can be “
  • ” or “
  • ”, however, in the resulting PDF instead of the format change I just see the variable text.

    This indicates that the format is rendered first and only after the variables content is inserted.

    Is this correct ? Is there another way I acan accomplish what I need ?

    Thanks for your help