Questionnaire - Dynamic values


Dynamic values enable you to define dynamic conditions and constraints for questions based on the results of SQL queries that are run when the variable is called. They use values in comparisons. The contents of these values may depend on the present moment or on the contents of values in the Product name - ev itsm.png database, etc.

  • They can be used in standard questionnaires and multi-section questionnaires.
  • Depending on their type, they may identify a date, string of characters, duration or number. Only questions whose type is identical can use them.
            Example documentation icon EN.png  Arrival date greater than or equal to the current date

Example

Define a constraint to ensure that the appointment date falls within 15 days following the current date.

1. Create the @now dynamic value in the reference table. The query evaluates the current date and time when the variable is called.

2. Associate the dynamic value with the questionnaire.

3. Define a constraint for the Appointment date Example - Date entry.png question via a comparison with the @now dynamic value. An error is generated if the date entered by the user is greater than "@now + 15 days"

4. When the questionnaire is run:

  • The @now value is evaluated and is equal to the current date.
  • If the user enters an appointment date that is not within 15 days following the current date, an error message will appear, The appointment date must be within 15 days from today.

Notes

  • The @ character automatically precedes each variable.
             Example documentation icon EN.png  @now: Current date and time
  • The list of dynamic values is provided by Logo - EasyVista.png. You cannot delete the values.
  • A dynamic value can be associated with several questionnaires. If the link between a given dynamic value and a questionnaire is deleted, this does not affect its links with other questionnaires.
  • If the type of a dynamic value is modified in a questionnaire, its link with constraints or conditions will automatically be deleted.

Caution

  • If you modify the type of a dynamic value that is being used in a condition or constraint, its link with this condition or constraint will automatically be deleted.

Best Practice big icon.pngBest practice

  • In List mode, the default view is Questionnaire. If no dynamic value is associated with a questionnaire, you should use the List view.

Screen description

Dynamic value editor.png

Menu access: 

  • Operation > References > Questionnaires: Dynamic Values
  • Transition >  References > Questionnaires: Dynamic Values
  • In a questionnaire, select the Manage Questions wizard > [ CREATE A NEW DYNAMIC VALUE ]
     

Name: Unique ID of the dynamic value.

Type: Type of dynamic value. The possible values are String, Date and Time, Decimal and Duration.

Description: Description of the dynamic value.

Content: SQL query run when the dynamic value is called for a question. Open url.png See the examples of SQL queries.

Procedure and Wizards

How to create a dynamic value

1. Select Operation > References > Questionnaires: Dynamic Values  or  Transition > References > Questionnaires: Dynamic Values.

2. Click Add icon.png and specify the information on the new dynamic value.

3. Click [ SAVE ]. The new dynamic value will be available for all questionnaires regardless of the menu in which it was created.

How to use dynamic values in a questionnaire

1. As dynamic values are calculated when the questionnaire is run, you should associate only those you want to use for conditions or constraints in questions.

  • Select the Manage Questions wizard.
             Manage the questions wizard.png
  • Click [ ASSIGN THE DYNAMIC VALUES ] and click Add icon.png to select the dynamic values you want. Note: The list will display the values already associated with the questionnaire.
             Assign dynamic values.png
    Note: If you create a new dynamic value directly in a questionnaire, it will automatically be associated with this questionnaire. It will also be added to the reference tables and will be available for all questionnaires.
     

2. You can now define the constraints and conditions for questions using one of the dynamic values associated with the questionnaire.

  • To define a constraint:
    • Click Constraint icon.png or No constraint icon.png in the Constraint column of the question.
    • Select Compared to a Dynamic Value from the Option drop-down list. Enter the condition or value applicable. Note: Only dynamic values whose type is identical to the question will be available.
  • To define a condition:
    • Click Condition icon.png or No condition icon.png in the Condition column of the question.
    • Select one of the four options available: Contains/Does not contain the dynamic value, Starts with/Does not start with the dynamic value and enter the condition or value applicable. Note: Only dynamic values whose type is identical to the question will be available.

3. When the questionnaire is run via a workflow, each dynamic value will be evaluated in the constraints and conditions using it.

Wizards

Update: Used to modify the dynamic value, i.e. code, description or SQL query.

Delete: Used to delete the dynamic value (Note: Only if it is not being used in a questionnaire or if it was not provided by Logo - EasyVista.png).

Examples of SQL queries

  • Return the first day of the previous month ==> 1stDayOfLastMonth variable
SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, DATEADD(MONTH, -1, GETUTCDATE())), 0)
  • Return the first day of the next quarter ==> 1stDayOfNextQuarter variable
SELECT DATEADD(QUARTER, DATEDIFF(QUARTER, 0, DATEADD(QUARTER, 1, GETUTCDATE())), 0)
  • Return the last day of the current month ==> lastDayOfTheMonth variable
SELECT DATEADD(DAY, -1, DATEADD(MONTH, DATEDIFF(MONTH, 0, DATEADD(MONTH, 1, GETUTCDATE())), 0))
Tags:
Last modified by Unknown User on 2017/03/31 19:50
Created by Administrator XWiki on 2017/03/31 19:50

Shortcuts

Recent Updates

Haven't been here in a while? Here's what changed recently:

-   Product name - ev itsm.png
-   Product name - ev sas.png

Interesting Content

How to Automate Integration
Add a Shortcut to an App
History
Quick Dashboard
Full text search - Stop Words

Powered by XWiki ©, EasyVista 2018