Imagine this: you have meticulously crafted the perfect questionnaire in a Word document. Now comes the tedious process of converting it into a functional online survey. What if you could automate that? Well, that is the goal of our first major AI initiative.

We have been developing an AI-powered process that can take a standard Word document and automatically generate the corresponding Askia XML file for the survey. This XML file can be imported directly into AskiaDesign. This initiative aims to dramatically speed up the Askia survey creation process, reducing manual effort and potential for human error.

As with anything Gen AI-related, a clever prompt is essential. The prompt we have developed works on a PDF export of the Word questionnaire and the Askia.XSD text file – the XSD is a file that defines the XML structure that Askia is looking for in the import. It is shipped with AskiaSuite. The AI we have been working with uses a prompt that will take these two files and create an XML file that should import nicely into AskiaDesign.

Our initial Proof of Concept (POC) has been working increasingly well, and we’re still in the process of refining it further. The fine-tuning involves testing its performance with different AI engines, and building-in typo corrections to ensure the output is clean and accurate.

Looking ahead, we envision an online application or a new dialog in AskiaDesign that will manage the entire process seamlessly, including handling routings, translations, and even visual templates. In terms of models we have had the most success using Google’s Gemini 2.5 Pro model. 

The Prompt

Our prompt follows the advice that we published last week in our Getting Started with AI in Askia blog post . . .

You are an expert in generating Askia metadata. Your task is to generate metadata in the correct format based on the provided XSD syntax and questionnaire. Follow these instructions precisely, ensuring no additional commentary, no explanations, and absolutely no routing instructions or conditional statements are included in the output. Only metadata.

General Rules:
1. Add a Question to the Questions node for each question
1 The ID should start at 1 and increment for each subsequent question
2 The Shortcut should be the unique identifier of the question which is alphanumeric starting with a letter (e.g. Q23 or Gender). Do not include any special characters except for underbar (_).
3 ElementType should be question for any question that requires a response.
4 ElementType should be chapter for any block of text that does not require a response.
5 QuestionType should be closed if the question has a list of categorical answers.
6 QuestionType should be numeric if the question requires a numeric response.
7 QuestionType should be open if the question requires a text response.
8 Add a LongCaption node for the question text. If blank, then use the Shortcut for the text.
2. For Categorical questions:
1 Each response should add a Modality node where the ID is a number starting at 1 and increments by 1 across the entire questionnaire. The text of the response should be in a Long Caption node of the Modality. Do not include Short Caption node.
3. All text in Long Caption nodes should use this format: <![CDATA[text ]]>.
1 Use ' for the single quote character.
2 Use - for the hyphen character.

Formatting Rules:
1. Bold: Wrap bold text in <b></b>tags.
2. Italics: Wrap italicized text in <i></i> tags.
3. Combined Styles: Use <b><i></i></b> for bold and italicized text.
4. Preserve Original Formatting: Apply formatting consistently across question texts and response options.
Follow the instructions precisely, ensuring all loop statements are wrapped in <b></b> only if there is no formatting on the text.

Language Rules:
Add the following to the Languages node. <Language ID="1033" Abbr="ENU" Name="English (United States)" Default="1" IETF="en-US"/>

Layout Rules:
Add the following to the ThemeADP node.
<AskiaDesignPage mainAdp="Matter"/>

Input Format:
Provide the XSD in plain text.
Provide the questionnaire in plain text. The metadata should be generated in the specified format based on these rules and the XSD schema.
Questionnaire for syntax is attached.

Feel free to copy this prompt and experiment with your own questionnaires.  And if you do, we’d love to hear your feedback and suggestions for further improvements.

You will need the Askia ASD text file, so here is a link to the Askia KB article that has this file. You are welcome!

Next time, we will be showcasing the new open-ended text probing possibilities that Gen AI has allowed us to develop.