Data Conversion

The Data Conversion facility allows you to change the values held in a Data Source or Custom View column to something different when displayed within your app, usually to something more meaningful to the user, or to provide a visual guide to the data's content.

For example, you could have a list of jobs, each with a status value indicating its progress, such as 0 for "Not started", 1 for "Started", 2 for "Awaiting Parts" etc. The Data Conversion facility could be used to display the status values as meaningful text, "Not Started", "Started" etc., rather than the 0, 1 ... etc. stored in the actual database, so that your users don't have to know the code values. You can also convert data values into images, allowing you, for example, to include a visual representation of the job status giving users an at-a-glance view of the status of each job. In addition, you can apply a Style to each input value allowing you to change the font, change the colour of the text or background and/or embolden or italicise text to readily highlight the job's status, such as displaying a red background for urgent jobs and a green background for completed jobs based on the status value in each record.

Data Conversion can also be used to reverse these changes, so that the values displayed on the form are converted back to the required values for the database when data from the form is written to the current record.

The feature allows you to create a set of Conversion Tables which define your conversions which you can then allocate to a Control within your app. The Conversion Tables are not specific to a Data Source, Custom View or column within a data table nor to a Control; rather, they simply provide a list of values to be read or written and the corresponding display values or images and any Style you want to be applied. This means that you could use the same Conversion Table for different data if applicable. For example, if you had two Data Sources both using the same Status data values, you could use the same Conversion Table to convert both to the same consistent set of pictures.

You can also use the same Conversion Table for both input and output data conversions, for example where Controls have input and output mappings to the same data table. An Input Data Conversion will be applied to data being read from a record in a local database table to a Control and an Output Data Conversion will be applied to data being written from a Control to a record in a local database table.

 

You can perform Input Data Conversions for most Controls providing the data assigned to the Control is alpha-numeric.

Output Data Conversions are only available for Edit Controls, HTML Text Controls, Combo Boxes, List Boxes and Static Controls.

 

Data Conversion Tables are assigned to a Control using its Input Conversion or Output Conversion Properties. Assigning a Conversion Table to a Control's Input Conversion Property will act upon data being read from a local database column into the Control, converting the values read in according to the specification in the Conversion Table and displaying the converted values in the Control instead of those stored in the actual database. Assigning a Conversion Table to its Output Conversion Property will act upon data being read from the Control and written to a local database table, converting the displayed values into the required values for storage in the database table.

 

Conversion Tables are created, viewed and edited using the Data Conversions dialog box which is also accessed from the Input Conversion or Output Conversion Properties of a Control (see below). When you create a new Conversion Table it will automatically be applied to the Property from which you create it. An existing Table can be applied manually to either or both Properties for a Control.

 

  • The changes you make in the Data Conversions dialog box are saved within App Studio as you go along, but you will still need to save your Project in order to save the changes within the Project. If you do not save your Project, the next time you load it your changes will have disappeared. We recommend that you save the Project from time to time as you are working and when you publish a Project, it is automatically saved, if necessary, before being published.