Troubleshooting K-fields
Here are some common K-field issues and how to troubleshoot them.
- Missing semicolons
- Duplicate K-field names
- No return function
- Feedback fields not backfilled
- Testing with different survey results
Missing semicolons
While editing the calculation, a cross image can indicates a missing semicolon.
Include a semicolon after closing the brace.
Duplicate K-field names
The label (identifier) for a K-field must be unique; when it is a duplicate of an existing K-field, this error occurs:
No return function
Make sure to add return for return type:
Feedback fields not backfilled
While using standard JavaScript functions, Feedabck fields must be backfilled, otherwise it may result in an error stating the Unknown global variable:
Testing with different survey results
Check the result using a Survey ID (if responses are available) for a response:
The example above is testing the result for Survey ID 137013. Use different IDs to validate the calculation against different results.
Using the Seqnum function
When using the seqnum function in the K-field, the seqnum being returned should be mapped to the numeric value and the result is not relevant:
f = function() {
var store_wait = seqnum(q_fulfillment_osat_store_wait_time_11pt_sat);
var survey_type = seqnum(e_target_survey_type_alt);
//Check for Drive up
if(survey_type == 32){
return store_wait;
} else {
return null;
}
};
f();
