Activate certain text based upon the value of a string (i.e. radio button)

18 views
Skip to first unread message

Kurtis Saiyo

unread,
Apr 22, 2016, 12:57:05 PM4/22/16
to floreysoft
I've been using Trigger with Template Designer.

There is a place in my template that I wish to only display text based upon the value of a radio selected option on Forms. The documentation shows an example where if a variable is set, but no example exists showing how to do something with a value of a variable. I can do this same thing with check boxes, but I do not want the individual filling the form to select more than one value, hence the radio option. 

For example, in forms I have the following question:

Cause of the Fire
Is the cause of the fire known or unknown
    • known
    • unknown
The above creates a string variable called "causeofthefire" and assigns the string "known" or "unknown" based upon the selection. What I would like to do is only display certain blocks within my template to display when either known or unknown is selected. Basically IF causeofthefire equals "known" then display one set of text, else display another block of text.

For example, in doc template designer I have the following block:

${if causeofthefire=known}The analyses determined that the cause of this fire can be directly related to ${event} ${else}. The area of origin is ${areaoforigin;string}, however due to the extent of damage and fire department overhaul... blah blah blah .${end}

The above is obviously incorrect because it doesn't work (if it worked I wouldn't be asking the question), but it does show what I would like the IF function to do. I've played with the variables to try and see if its just a syntax thing like  ${if causeofthefire;string=known} and ${if causeofthefire known} and ${if causeofthefire.known} to no avail.

Thank you
 

Daniel Florey

unread,
Apr 22, 2016, 1:21:32 PM4/22/16
to floreysoft GmbH
You statement looks correct to me and it should work that way.
What do you get if you simply print the variable in your template?
${causeofthefire}


This e-mail and any attachments may contain confidential and privileged information. It is intended for use only by the person to whom it is addressed. If you are not the intended recipient or have received this in error, please notify us immediately by return e-mail, delete this e-mail, including all attachments, without copying, distributing or disclosing same. Any dissemination or use of this information by a person other than the intended recipient is unauthorized and may be illegal. Any review, re-transmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. E-mail is not a secure means of communication. Please advise us if you would prefer to use an alternate form of communication. We accept no responsibility or liability for loss or damage arising from the receipt or use of this transmission.

--
You received this message because you are subscribed to the Google Groups "floreysoft" group.
To unsubscribe from this group and stop receiving emails from it, send an email to floreysoft+...@googlegroups.com.
To post to this group, send email to flore...@googlegroups.com.
Visit this group at https://groups.google.com/group/floreysoft.
For more options, visit https://groups.google.com/d/optout.

Kurtis Saiyo

unread,
Apr 22, 2016, 1:32:01 PM4/22/16
to floreysoft GmbH
Thanks for your prompt reply!

I selected "known" on the Ultradoc and saved. Then used the preview button on the template building block.
Here is my template "code":

${causeofthefire}

${if causeofthefire=known}The analyses determined that the cause of this fire can be directly related to ${event;string}. ${else} The area of origin is ${areaoforigin;string}, however due to the extent of damage and fire department overhaul the cause cannot be determined to a reasonable degree of certainty.  The ignition sources identified in the area of origin include ${ignitionsources;string}.  The probable ignition source is ${probableignitionsource;string}.${end}


The output on the preview is this:

known 
The analyses determined that the cause of this fire can be directly related to . ${else} The area of origin is , however due to the extent of damage and fire department overhaul the cause cannot be determined to a reasonable degree of certainty. The ignition sources identified in the area of origin include . The probable ignition source is .

Note that it's printing the ${else}. What a head scratcher.



You received this message because you are subscribed to a topic in the Google Groups "floreysoft" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/floreysoft/MqrvFW2M0DE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to floreysoft+...@googlegroups.com.

To post to this group, send email to flore...@googlegroups.com.
Visit this group at https://groups.google.com/group/floreysoft.
For more options, visit https://groups.google.com/d/optout.

Daniel Florey

unread,
Apr 22, 2016, 1:41:44 PM4/22/16
to floreysoft GmbH
Strange... could you please try:
Selecting the text block and remove all formating.
If this does not help, can you try with a simple statement like
${if causeofthefire=known}text1${else}text2${end}
and check if this works?

Kurtis Saiyo

unread,
Apr 22, 2016, 2:17:30 PM4/22/16
to floreysoft GmbH
Removing the formatting did not seem to make any difference.
Interesting, The simple statement worked.

Code:

${causeofthefire}

${if causeofthefire=known}The analyses determined that the cause of this fire can be directly related to ${event;string}. ${else} The area of origin is ${areaoforigin;string}, however due to the extent of damage and fire department overhaul the cause cannot be determined to a reasonable degree of certainty.  The ignition sources identified in the area of origin include ${ignitionsources;string}.  The probable ignition source is ${probableignitionsource;string}.${end}


${if causeofthefire=known}text1${else}text2${end}


Output:

known The analyses determined that the cause of this fire can be directly related to . ${else} The area of origin is , however due to the extent of damage and fire department overhaul the cause cannot be determined to a reasonable degree of certainty. The ignition sources identified in the area of origin include . The probable ignition source is .
text1

Kurtis Saiyo

unread,
Apr 22, 2016, 2:29:39 PM4/22/16
to floreysoft GmbH
When I copy the original and paste it just below, it works. It must be an incomplete ${foreach...} or ${if...} somewhere above in the template that confusing it, but I cannot seen to find it. Thank you for your help!
Reply all
Reply to author
Forward
0 new messages