In certain situations, documents require data points that are not natively stored in Athennian (eg. director remuneration), or information that varies each time you generate certain documents (eg. loan amount). Custom prompts allow users to answer a question at the time of document generation to populate the information based on the answer.
Setting Up Custom Prompts
Custom prompts require "set-up" in two places:
Coding Custom Prompts in Document
- Determine the parameters of your custom prompt. This is what you will use to add the prompt into the Template Manager:
- Create a variable name that does not contain spaces
- Consider using camel case for consistency with other variable names
- Best Practice 💡 Tip: Add CP to the end of your variable name to easily identify it in your document, and for easy find and replace if changes need to be made (eg. {paymentMethodCP})
- Decide on the question users will answer
- Decide how the users will answer the question (multiple choice? true/false? fill in the blank?) and provide answers to select from if necessary.
- Create a variable name that does not contain spaces
- Use your custom prompt in your coding.
Template Manager Settings
-
Go to the settings of the document you would like to add a custom prompt to and click “Prompt.”
- The Custom Prompt pop up will give you the option to choose a pre-existing custom prompt or to create a new one. Click “New” to create a new prompt.
-
Insert the new variable name.
- Type your question in the question box. If there are specific instructions for the user at the time of document generation, feel free to include that here as well (eg. If the dollar value should be entered in a specific format, add that instruction: "Please enter the amount in 0.00 format.").
-
Choose a fill type and, if applicable, provide the corresponding choices for users to select.
- Once your prompt has been created, select it to add it to your template settings.
Fill Types
Text Fill: "Multiple Choice"
Text Fill will provide the user with a multiple choice question. Use the choices tab to provide the choices.
The Answer box will be what the user sees while the Fill Text will be the output in the document.
User View at the time of document generation:
True/False
True/False provides the user with boolean choices. You can provide more than 2 choices, however the output will only be true or false.
User view at the time of document generation:
User Fill: "Fill in the Blank"
User Fill will provide the user with a freetype text box. The output will be exactly what the user types into the box.
User view at the time of document generation:
Coding Custom Prompts
Custom prompts can be used in a variety of different ways depending on the output of the prompt.
As a Variable
You can use the custom prompt as a simple variable.
User Fill
Sample Custom Prompts Settings |
Variable: {assemblerInitialsCP} Fill Type: User Fill Question: Please insert the assembler initials. |
User Response | JPA |
Input | The assembler's initials are {assemblerInitialsCP}. |
Output | The assembler's initials are JPA. |
Text Fill
Sample Custom Prompt Settings |
Variable: {paymentTypeCP} Fill Type: Text Fill Question: How will payment be made? Option 1 - Cash (cash) |
User Response |
Cash |
Input |
The type of payment is {paymentTypeCP}. |
Output |
The type of payment is cash. |
With Logic
You can also use custom prompts with logic. Based on the choice the user selects at document generation, we can determine the appropriate conditional content that appears. For more information on logic, check out the article on Logic & Conditions.
True/False
Sample Custom Prompt Settings |
Variable name: {assemblerExists} Fill Type: True/False Question: Does an assembler exist? Option 1 - Yes (true) |
User Response |
Yes |
Input |
{#assemblerExists==true}There is an assembler{/}{#assemblerExists!=true}There are no assemblers{/}. |
Output |
There is an assembler. |