iFormBuilder JavaScript Tips & Tricks
Here's what you need to know:
What is the Location element?
The Location element is used to capture GPS data of the current geolocation when the element is engaged. The element captures GPS Location Data for Latitude, Longitude, Altitude, Speed (m/s), Horizontal Accuracy(m), Vertical Accuracy (m), and Time.
Click here for more information on the Location element and how to add it to your form.
What is the Text element?
The Text element allows users type in up to 50 characters into a field on your form.
Click here for more information on the Text element and how to add it to your form.
How do I parse location data?
To parse the data captured by the Location element, follow the instructions below.
STEP 1. Under the Location Element in your form, add a Text Element and name it accordingly. In this example, we've named it Longitude as that is the data we will be parsing.
IFORM TIP: In the Dynamic Value of Location widget put: my_location="". This will ensure that the location data will reset with each new record.
Note that my_location is the data column name of the Location Widget in this example.
STEP 2: In the Dynamic Value of the Text element, put: my_location.longitude. This is telling the element to pull in the Longitude value of the Location element above.
To parse out different location data, you can use the examples below:
- my_location.latitude
- my_location.longitude
- my_location.altitude
- my_location.horizontalAccuracy (For iOS only)
- my_location.verticalAccuracy (For iOS only)
- my_location.accuracy (For Android only)
- my_location.speed
- my_location.time
STEP 3: Test it out on your device.
Click on the Location element.
Press Done.
You'll see the location data has been parsed to the appropriate fields.
Use the below form package for an example of parsing location data.
Comments
0 comments
Please sign in to leave a comment.