Problem Resolution¶
Submitted Data does not appear in the console or analysis module¶
The first place to look is Monitoring, Select the "submitted" tab and see if your survey has anything in the "Errors" column.

Monitoring Page Showing an Error
To view the reason for the error; change "Show" to "Last 200". This will show details on each submission. You can filter to only show Errors if you want to zero on the errors.

Error Details
In the above image, the error is caused by an answer of type "text" (character varying) being written to a column of type integer in the database. The column name is "id". When you are editing a survey you cannot change a question of type integer to text. If you come across this follow the instruction in Question type has changed to an incompatible value to resolve it.
Question type has changed to an incompatible value¶
The easiest way to fix this is to Deleting and Restoring Data the survey in the analysis module.
Warning
Restore first deletes the old data including its table then recreates it with the latest survey definition, so the latest question types, it then reapplies all of the submissions. However this won't always work. Firstly if you have changed the data since it was submitted then you will lose all of those changes. Secondly if you changed the data type from say "text" to "integer" and if some of the early submitted data was values like "Only One" then that will now fail when the submissions are reapplied. However changing integer to text should always work. In both of these cases you will need to use one of the other methods described below..
Fixing incompatible types with backup restore¶
- First backup the existing data
- Then delete the data using the analysis module (Deleting and Restoring Data)
- Then restore the backed up data
- Finally using the monitoring page re-apply the failed submissions (Re-apply failed uploads)
Fixing incompatible types using SQL statements¶
- Get the table name using the online editor and selecting the menu "File" and then "Info"
- Open the "results" database
- Get the column name, this will be similar to the question name but all lower case. in psql use:: \d {table name}
- Alter the column type in PSQL: alter table {table name} alter column {column name} type {new type}. For example: alter column id type text;
- Types could be text, integer, timestamp with timezone or double precision
- If there is incompatible data already in the table you will have to do some conversions to new valid data
- Then go to the monitoring page, select the survey and click on "Re-apply Failed Uploads"
Odd errors in Calculations¶
Calculations are computed whenever a dependency changes. This means that you can't use relevance to prevent a calculation that uses invalid data and sometimes, if your calculations are complex, they may try to compute values at unexpected times.

Calculation Error in FieldTask
These errors may not occur in webForms as it handles edge conditions such as undefined values differently.
The first step in problem resolution is to isolate the problem. In the above image the error is happening in a question called "Date_complainant" inside a repeating group. Try deleting this question, and any other questions that create errors, until your form is working.
Then you can add the questions that cause an error back in, one by one, and examine and adjust their calculations. So in the example above the error was occurring when a "Complainant" was selected. The calculation looked like this:
format-date(date(if(${number_recs_complainant} >= position(../..), pulldata('linked_s10_116', 'Date', 'Name_of_Complainant', ${complainant}, position(../..), 'matches'), '')), '%Y-%m-%d %H:%M:%S')
I modified the "if" function to only lookup and format the date if the complainant value was set. That is the value was longer than 0:
format-date(date(if(${number_recs_complainant} >= position(../..) and string-length(${complainant}) > 0, pulldata('linked_s10_116', 'Date', 'Name_of_Complainant', ${complainant}, position(../..), 'matches'), '')), '%Y-%m-%d %H:%M:%S')
That did the trick.