Hi,
I am trying to show or hide a text box with some text in using a condition but cannot get it to work in pres connect designer
In planet press design 7, I just made a condition called “marker” that looked at the ClaimRef number data and set the condition type to “on value change” then created a text box with some text in and in the properties/basic attributes window just set it to the condition I had just created so, if the ClaimRef was the same on the next document it would hide the text box, if it was different then it would show the text box
In pres connect designer there does not seem to be the option to choose “on value change” in the drop down box when using the make conditional script.
you can use a workaround. Create a new field in the datamapper (rename it to e.g. “change”). Paste the following code in the javascript section of that field (change the field name you want to check for change).
var code, newCode, results = false, codeTotal = 0;
var startValue = 1;
var incrementValue = 1;
var stepToReset = 2;
var counter = record.index;
if(stepToReset) counter = ((record.index-1) % stepToReset) + 1;
if(incrementValue) counter = (counter * incrementValue)-incrementValue;
if(startValue) counter = startValue + counter;
//Replace RECORDFIELDNAME with the field name you want to check for change state:
if(counter == 1) code = record.fields.RECORDFIELDNAME;
if(counter == 2) newCode = record.fields.RECORDFIELDNAME;
if(code == newCode){ results = false; }else{ results = true;}
In your design template you can than set your condition based on the new field “change”.
PS: The first record of each “set” will be treated as changed (result in the new data field = true).
Apologies for the late reply, i have tried what you suggested but the text box still shows on the following page if the ClaimRef is the same
I must be doing something wrong.
I have a text box that i type the following text in which is not in the data #S#DailyHBletter0529#
There is a number in the data which i have mapped and called ClaimRef
if the next separate page of data has the same ClaimRef number i want the #S#DailyHBletter0529# in the text box not to show on that page
It would be so much easier if the “on value change” was added in the conditional script drop down choice like it is in PP7
Apologies for the late reply, i have tried what you suggested but the text box still shows on the following page if the ClaimRef is the same
I must be doing something wrong
I have a text box that i type the following text in which is not in the data #S#DailyHBletter0529#
There is a number in the data which i have mapped and called ClaimRef
if the next separate page of data has the same ClaimRef number i want the #S#DailyHBletter0529# in the text box not to show on that page
It would be so much easier if the “on value change” was added in the conditional script drop down choice like it is in PP7
I have not looked at this in years. However, taking my template and mapper I linked above, I added a positioned box on the Letter Section, right clicked it and selected make conditional. I then selected the OnChange field and set it to hide if true. The positioned box wont appear until the ADDRESS field changes. So it is working as expected.
(Keep in mind that if you cycle through your records in preview mode, and want to recycle through them, you have to select design mode and then preview so that the first record does not show the box. Same applies the the splitter section.)
Regards,
S
PS. In hindsight my OnChange should have started with false instead of true.
I have it working now, the first record shows the box then if the ClaimRef is the same on the next record it does not show the box:)
I did not realise you had to do the following
(Keep in mind that if you cycle through your records in preview mode, and want to recycle through them, you have to select design mode and then preview so that the first record shows the box