• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
      • Overview
      • Execution Environments
      • Security and Formatting Options
      • Base Actions
      • Application Namespace
        • Application Action Invoker Namespace
        • Application.getFormFile Action
        • Application.getQuestionnaireContent Action
        • Application.getQuestionText Action
      • Clipboard Namespace
      • Data Namespace
      • Dictionary Namespace
      • File Namespace
      • Hash Namespace
      • Localhost Namespace
      • Logic Namespace
      • Message Namespace
      • Path Namespace
      • Settings Namespace
      • Sqlite Namespace
      • System Namespace
      • UI Namespace
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

Application.getQuestionnaireContent Action

Format
s = CS.Application.getQuestionnaireContent(ʃname := ...ʅ
                                         
ʃ, key := ... ‖ uuid := ...ʅ
                                         
ʃ, serializationOptions := ...ʅ)
ArgumentDescriptionTypes / Required
nameThe name of a form file or dictionary associated with an application, or the name of an application.string
not required
keyThe key (case IDs) of a specific case to attach to the questionnaire content.string
not required
uuidThe UUID of a specific case to attach to the questionnaire content.string
not required
serializationOptionsOptions for how the case should be serialized (if applicable).object
not required
Description
The Application.getQuestionnaireContent action returns the questionnaire content associated with an application, form file, or dictionary. Questionnaire content, which can be used an input to the questionnaire view, is considered:
  • The dictionary, returned with the name "dictionary".
  • The form file, returned with the name "forms".
  • The question text, returned with the name "questionText". This is only included when name specifies an entity that is associated with a data entry application that uses question text.
  • The case, returned with the name "case". The optional serializationOptions argument allows you to specify how the case should be serialized, potentially overriding the default application settings.
Each of these content values is the same as returned by the actions: Dictionary.getDictionary, Application.getFormFile, Application.getQuestionText, and Data.getCase.
If name is not specified, the questionnaire content associated with the application's main dictionary is returned.
If neither key nor uuid are specified, the current case associated with the dictionary is returned. If one of those arguments is specified, the case identified by that argument is returned. If both key and uuid are specified, then the uuid value is prioritized.
Because CSPro optimizes the reading of case data, you may need to disable the dictionary's Read Optimization setting when using this action on external dictionaries or in batch applications.
Return Value
The action returns the questionnaire content with the dictionary, forms, and, if available, the question text and case data.
Exceptions
The action throws an exception if any of its arguments are not specified in a valid form, or if:
  • No dictionary, or associated dictionary, exists with the specified name.
  • No case exists as specified by the key or uuid arguments.
  • An error occurs while reading the case from the data source.
Example (CSPro Logic)
if selcase("Select a Case to View", CEN2000, "") then

   
// construct the input needed for the questionnaire view from the selected case
    string questionnaireViewInput = CS.Application.getQuestionnaireContent(name := "CEN2000");

   
// pass this input to the questionnaire view
    CS.UI.view(path := Path.concat(html, "questionnaire-view", "index.html"),
               
inputData := @object questionnaireViewInput);

endif;
Note that although this example demonstrates a use of this action, a simpler way to do the above is:
if selcase("Select a Case to View", CEN2000, "") then
    CEN2000.
view();
endif;
See also: Application Action Invoker Namespace, Questionnaire View