Hello, I’m putting together a letter template and I have a few element that I’m hiding or showing depending on variable data. I have some set to show only when data equals a certain value and some set to show when data begins with a certain character - however when I try to use the option to show when data ends with a certain character, the script is broken.
If I simply choose the option of setting the element as ‘Make Conditional…’ by right clicking on it and then telling it to Show - when the datafield - Ends with - the value, and press ‘OK’, the script comes up in the Scripts window with a small red ‘x’ by it and if I hover over it with my cursor it shows me a note saying “missing ) after condition”.
If I click into the script and expand it I can see that the default script is
It shows an ‘x’ to the left of the first line, and underlines the open curly bracket at the end. I have tried putting a close bracket ‘)’ in various places near the end of this line but either it flags up a different kind of error in the script when I change it or on testing it my new form of the script doesn’t do what I wanted it to do (i.e. only show the element when the datafield on the record ends with that value).
Is there anyone with a better grasp of JavaScript than I (i.e. any grasp of it at all!) able to advise me how I could fix the script?
Thanks, Erik, unfortunately that was one of the modifications I tried before (and I’ve just tried it again just in case) and although it no longer indicates an error when the parenthesis has been added, when I put some test data through the condition does not work. The element will show whether the data ends with the value or not, even though the other conditional elements appear to be toggling visibility correctly.
Ricoh, yes, you can test if your conditions are working or not on the preview tab if your sample data contains the right set of values. I’ve been testing mine straight through the final Workflow process.