From wiki.ginstr.com
(Redirected from Variables)
Jump to: navigation, search

Variables

Variables represent an in memory storage to hold states and information during single session of ginstr app. If ginstr launcher is restarted variables information stored in memory is lost.
Variable definitions are stored for ginstr app in file “database/variables.xml”.
If this file is missing then variables are not active in the ginstr app and all actions that work with them can not be used, or strange results will appear when trying to use nonexistent variables.
Variables can be used by ginstr actions as a source and as a target.
Example of variables.xml content:
<?xml version="1.0" encoding="utf-8"?>
<variables>
  <variable id="attendeeId" type="text"></variable>
  <variable id="employeeUsername" type="number" defaultValue="100">-50</variable>
  <variable id="employeeFirstName" type="text"></variable>
  <variable id="employeeLastName" type="text" defaultValue=""></variable>
  <variable id="materialsOriginScreen" type="text"></variable>
</variables>

XML Attributes Description

Attribute Description
id represents unique identifier of variable in a ginstr app
type defines a type of variable.

More information here

columnType represents type of value if variable type is rowsColumn which can contain different data types.

Can be

defaultValue defines default variable value, used by gn:act_resetVariables action
getPointerValue represents a flag which will be used during data type conversions, to convert pointer value to text

Works only if type is pointer

Can be

  • true
  • false
initialValue represents initial value which will be set at variable initialization.

Can be

  • hardcoded
keepOnAppUpdate keeps the existing variable values when the app is updated.

Can be

  • true
  • false

Variable types

Variable Type Example
text <variable id="divisionForEmployeeExists" type="text" defaultValue="0">0</variable>
number <variable id="employee_employeeNumber" type="number"></variable>
status <variable id="report_usingBoxesForClothes" type="status" />
dateTime <variable id="timeFuture" type="dateTime">3300518400000</variable>
date <variable id="parkingCardBookingDate" type="date"></variable>
phoneNumbers <variable id="subPhoneNumber" type="phoneNumbers"></variable>
pointer <variable id="site" type="pointer" getPointerValue="true"/>
signature <variable id="report_employeeSignature" type="signature"/>
pictures <variable id="ownership_pictures" type="pictures"></variable>
audio <variable id="audioFile" type="audio"></variable>
video <variable id="videoFile" type="video"></variable>
documents <variable id="documentFile" type="documents"></variable>
email <variable id="employee_SSOusername" type="email"></variable>
GPS <variable id="additionalReport_checkpointGps" type="GPS"></variable>
assignment <variable id="additionalReport_assignment" type="assignment"></variable>
time <variable id="parkingCardBookingTime" type="time"></variable>
iBeacon <variable id="iBeaconList" type="iBeacon"></variable>
rows <variable id="notification_rows" type="rows"></variable>
rowsColumn <variable id="entityList" columnType="text" type="rowsColumn"/>
dateTimeDiff <variable id="vehiclesDateTimeDiff" type="dateTimeDiff"/>
counter <variable id="vehiclesCounter" type="counter"/>
weekday <variable id="daysInWeek" type="weekday" defaultValue="monday,tuesday,wednesday,thursday,saturday,sunday"/>monday,tuesday,wednesday,thursday,saturday,sunday</variable>



This category currently contains no pages or media.