General Remarks on Data Sources

Last modified on 2022/08/17 17:48

Generalities

  • The types of data sources in each category of the library are defined by the EasyVista. You cannot create new ones.
  • Data sources are defined only once in the app library and are available to all of the widgets in the app.
  • Data sources used by the app are displayed by clicking on Apps - Manage datasources icon.png in the Objects pane in the graphical editor.
    • They are identified by icons that display their type. 
    • Those that point to an alias appear in bold.
    • A counter Utilization counter icon.png specifies the number of times the data source is used in the application. By hovering over it, you can view all of the widgets that use the data source.
               EVApps - GUI - Manage Datasources.png
  • Each data source has specific properties that are defined using the Properties Inspector. Mandatory properties are grouped in the Content category.
  • When you delete a data source, its link with all associated widgets will automatically be deleted.

Best Practice

  • We recommend that you use an alias to associate a data source with a database. It should point to a connector when the database does not change, regardless of the step in the deployment process.
  • Once you create a data source, you should rename it so that you can identify its function easily. When a data source is created, its default name is the type of data source incremented by ( n ) based on the number of the same data source type.

example  Online CSV ( 3 ) ==> third Online CSV data source defined for the app

  • You can use the Configure Field Types property to see a preview of the data in the data source. Then you can use the Data Transformer on each widget to define the structure and the scope of the data source.

example  
Apps - datasources Properties - Preview button.png   ==>  Apps - datasources Properties - Preview datasource.png

Static / Dynamic data sources

  • Static data sources:
    • They provide a snapshot of data at a given time. 
    • To refresh its contents, you must upload the data file again.

example  CSV data source

  • Dynamic data sources:
    • they display data in real-time. 
    • No manipulation is required from users or from the app administrator. Data is updated when the query is run automatically or when the Online file is reloaded automatically. 
    • Data is automatically updated each time the app is run and each time the page is redisplayed, regardless of whether it is in execute mode or edit mode. 
    • You can also use the Auto Refresh property to define the automatic refreshment interval.

Best Practice

  • Use a static data source to display fixed data or to run tests on the app's layout, if app data sources have not yet been implemented.
  • Use a dynamic data source when data changes on a regular basis.

 

Standard data source structure

As a general rule, a data source contains one Dimension column (1) (the first column) and one or more Measure columns (3) (the following columns). Note: If the Dimension and Measure columns are reversed in the data source, you should specify the property called Data > First Row Contains Dimension Elements.
         EVApps - widgets Properties - Datasource Structure.png

  • The dimension (1) includes dimension elements (2):
    • The name of the dimension is the header of the first column, e.g. Department.
    • The name of each dimension element appears in the first column of every row, e.g. Sales, Marketing, Administration.
  • Each measure (3) consists of values (4) defined for each dimension element, e.g. value 4.3 for the Incident per Employee measure and for the Sales dimension element.

Master-detail relationship

A master-detail relationship enables you to use a common key to link two sets of data from two different data sources in order to ensure that all of the records from one of the data sources (the detail set of data) will always match a single unique record in the other data source (the master set of data). There are two types of relationship:

  • (1,n) relationship: one record in the master data source corresponds to n records in the detail data source.

example  You want to display all records (detail) associated with an order (master); display all orders (detail) for a given customer (master); view all actions (detail) related to an incident (master); display all of the equipment (detail) for a specific user (master); or view all of the equipment (detail) of a given brand (master).

  • (1,1) relationship: one record in the master data source corresponds to one record in the detail data source.

example  You want to display information on the recipient (detail) associated with an incident (master)

Attributes

  • The master data source can be any type of data source and you can select the key from any of its fields.
  • The detail data source must be an EasyVista data source and you can select the key from the fields of the associated view.
  • A (1,1) master-detail relationship can only be defined using a form in the Data Viewer widget.

Best Practice

  • Use a (1,n) master-detail relationship to display a list of records in a Data Viewer widget associated with the master data source (main information presented in Line mode). You can then display the list of records corresponding to the current record in a second Data Viewer widget associated with the detail data source ==> This configuration is performed in the detail data source which must be an EasyVista data source.
  • Use a (1,1) master-detail relationship to display a list of records in a Data Viewer widget associated with the master data source (main information presented in Line mode). You can then query the detail data source using a second Data Viewer widget to display the detail of the current record (presented in Form mode) ==> This configuration which ensures optimal performance is defined in the Form properties of the Data Viewer widget.
  • You should be careful not to confuse the master-detail relationship with the drill-down functionality. Use the drill-down functionality when the data source contains aggregated data via an Product name - ev itsm.png view, e.g. the Equipment by location view.
  • Use master-detail data sources to restrict the number of records returned and ensure optimal performance, e.g. displaying all employees on a site may slow the system down if there are several thousand employees.

Examples

Displaying the list of actions associated with an incident ==> (1,n) master-detail relationship

       Master-Detail relation - Example Incidents-Related actions.png
1. Create a data source to search the list of incidents (Incidents master data source defined using the Operation > Incidents > All Incidents parent query) and an EasyVista data source to search the list of actions associated with each incident (Related Actions detail data source defined using the Operation > Actions > All Actions parent query).

  • The EasyVista detail data source must be linked to the master data source via the following properties:
    • Master Data Source = Incidents data source 
    • Master Field = PK identifying the Incident_ID column in the Incidents table (primary key in the table)
    • Detail Field = FK_AM_ACTION_REQUEST_ID identifying the action number related to the incident (foreign key in the table).

2. Add a Data Viewer widget called List of incidents and link it to the Incidents master data source.

3. Add a Data Viewer widget called Incident actions and link it to the Related Actions detail data source to display the list of actions for the current incident.
 

Displaying information on incident recipients ==> (1,1) master-detail relationship

       Master-Detail relation - Example Incidents-Recipient.png
1. Create a data source to search the list of incidents (Incidents master data source defined using the Operation > Incidents > All Incidents parent query) and an EasyVista data source to search the list of employees (Users detail data source defined using the Administration > Access Management > Employees parent query).

2. Add a Data Viewer widget called Incidents and link it to the Incidents master data source.

3. Define the Line Cell Format property of the data source:

          example 

<div>Creation Date: #[FIELD('{*RTZCONVERT(SD_REQUEST.SUBMIT_DATE_UT)*}')]#</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; ==> Recipient: #[FIELD('AM_RECIPIENT.LAST_NAME')]#</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; ==> Incident: #[FIELD('SD_REQUEST.RFC_NUMBER')]#</div>

4. Define the Form properties of the data source: 

  • Form Detail Data Source: Users data source containing information on incident recipients.
  • Form Detail Data Transformer: If required, select the fields you want to display in Form mode.
  • Form Cell Format: Define the form displaying information on recipients using the text editor.

          example 

<div>
   <table style="border-collapse:collapse;width:100%;">
      <tbody>
         <tr>
            <td><img src="#[FIELD('AM_EMPLOYEE.PICTURE_PATH')]#" /><br /></td>
            <td><span style="text-decoration: underline;">Contact</span>:&nbsp; #[FIELD('AM_EMPLOYEE.E_MAIL')]#<br /></td>
         </tr>
         <tr>
            <td><br /><span style="text-decoration: underline;">Recipient</span>: <span style="font-size: 18pt;">#[FIELD('AM_EMPLOYEE.LAST_NAME')]#</span><br /></td>
            <td><br /></td>
         </tr>
      </tbody>
   </table>
</div>

Profile and Default Domain of Apps

The EasyVista and EasyVista KPI data sources are based on two essential concepts.

  • Profiles:
    • In edit mode, they enable you to define the menu options that logged-in user is authorized to work with, e.g. the contents of the Query drop-down list.
    • In execute mode, they do not have any impact. Logged-in user can access all apps, regardless of the menu options used when designing the app.
  • Default domain:
    • In edit mode and design mode, they enable you to define the data that logged-in user is authorized to view.

Examples

1. Logged-in user A ==>  profile: Service Desk; default domain: USA IT Infrastructure

  • When in edit mode:
    • Based on the profile, user A can build apps using data sources related to incidents or requests but cannot use data sources related to IT equipment.
    • Based on the default domain, data sources will only display data related to the USA domain.
       
  • When in execute mode:
    • Regardless of the profile, the user can run all apps related to incidents, requests and IT equipment.
    • Based on the default domain, user A can only view data related to the USA domain.

2. Logged-in user B ==>  profile: IT Infrastructure Manager; default domain: Canada IT Infrastructure

  • When in edit mode:
    • Based on the profile, user B can build apps using data sources related to IT equipment but cannot use data sources related to incidents or requests.
    • Based on the default domain, data sources will only display data related to the Canada domain.
  • When in execute mode:
    • Regardless of the profile, the user can run all apps related to incidents, requests and IT equipment.
    • Based on the default domain, user B can only view data related to the Canada domain.
Tags:
Powered by XWiki © EasyVista 2022