Quick code to check a selection of variables for a code of 2 which is a fail. Checks all of the top variables [‘qnr_main_section1_PF’……..etc. If any of these are marked as code 2 and if so set var qnT = f(‘qnr_overall_QA_PF’); as 2 which is overall fail Else set to 1 which is pass var qIDsToCheck = […]
Validation Scripts – RegExr
Here are a selection of RegExr validation scripts to use with error messages. Correct Email format Checks to see if a email address has been formatted correctly if(!IsEmail(f(CurrentForm()))) { RaiseError(); SetQuestionErrorMessage(9,”Please provide a valid email address.”); } Correct Telephone format Checks a open question has 11 digits without spaces, i.e Phone number […]
Merge string and respid
Merging a string with the respid of the respondent to create a unquie ID which is targetable by a survey, email or reportal report. Create a new DP rule and select the survey and add in a filter, the field we are populating will be “userid” so make sure this field is empty using the […]
Visual Countdown for open text field length
This will show you how to add a twitter like character count down on to any open question within your survey. First off we want to enable the jquery library in your survey. Survey themes, select the one you are using. In the external Javascript URL paste this address into it //ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js This script will […]
Printing from Capi – Page Breaks
How to force page breaks when printing from Capi We have been working with printing from the Capi console (Confirmits Offline completion app). We are having to print off a results page. There is a couple of different sections ont he print out that require a start of a new page when printing. This will […]
If statement Expression
IF Statement Using the IF Statement in the reportal expression builder is much like using the IF statement within excel. if(cellv(col-1,row)>0,cellv(col-1,row)/cellv(col-1,6),0) If the cell value of the column -1 and row is greater than 0, do the calculation else put in 0. This is perfect for a percentage forumla on a table when there […]
Number of rows for Open text list
This is how to set the number of rows required by using a numberic field within the survey. Question 1 – open number field – Ask fior the number of something required Question 2 – open text list Question 2 – Masking – nset(f(‘Question1’).get()) Question 2 – Trigger – Question1 Once the number is entered […]
Add Print & date to reportal Page
Here is a quick and simple way to add in a print link and date to a reportal page. The print this page is a link which will open up the print dialog in your browser. Example below Script below <div class=”noprint”><a class=”strapline” href=”javascript:window.print()”>Print this Page</a></div> <script language=”Javascript”> <!– var now = new Date(); var […]
Clear or Reset Cells on your Form
This is some simple code to either “Reset” a user entry workbook or to clear cell values before / after use or on command. In this example the “reset” is connected to a button for the user once complete will show a message box “Worksheet Reset”, then to move the cursor to Cell C19 ready […]
Working out SLA Breaches with Excel!
Looking for a simple way to keep track of task and dates? This will help you keep track of SLA’s for a given task, log or project, when handy when dealing with a selection of items. We will guess that the threshold is 8 working days, we can then get Excel to display if the […]