AppMachine provides really powerful integration with data. In this document you will find all the datatypes that are supported by AppMachine when showing data in your app.
Read all the Frequently Asked Questions about webservices here.
Working with data types
Working with data imports through web services or Excel files means that you will be working with data. In order to give the user an even better experience you can specify data types on each field in the result of your web service. Doing so will let you do awesome stuff related to the data type. So let's say you have a field in your web service result specifying the price of a product. And during the import we detected the field, but thought it should be a decimal number. This is ok, and it will work. But if the data type of that field had been set to "Money" you could actually combine it with a checkout building block and the users could buy it from within your app.
So that's why it is important to setup your data correctly, in the first guide on integrating your own data using a web service we referred to changing data types during the import. But what data types do we actually support?
Supported datatypes
For output fields - external data - we do support a wide variety of data types. In the overview below you will find them all, with a brief explanation and information about when to use the data type.
Name | When to use | Description |
Array | When the child elements in the result of your web service are repeating elements. | Using this data type will mark the field as repeating so the child elements of this field can be used in a list control. |
Audio | When the value of this field contains a URL to an audio file or stream that should be playable from within your app. | The value of the field is pointing towards an URL that can be used for streaming audio. |
Date | When the value of this field contains a valid date without a time. | Using this data type will mark the field as a date field, so we can format it correctly and accordingly to the user's preferences. |
Date and time | When the value of this field contains a valid date and time. | Using this data type will mark the field as a date and time field, so we can format it correctly and accordingly to the user's preferences. |
Decimal | When the value of this field contains a decimal number. | Using this data type will treat the value of this field as a decimal value, this might come in handy when you are planning to sort on this field. |
When the value of this field contains a valid email address and the user should be able to send an email to this address. | Using this data type will display the field as a clickable text so that when the user clicks the value a new email compose window will be shown. | |
Image | When the value of this field contains an URL to an image. | Using this data type will mark this field as an image allowing you to actually display it as an image inside your app. Tip: In general AppMachine will cache by design, so external images will be downloaded just once so they will be available the next time, even when you are offline. |
Latitude | When the value of this field is a valid latitude (part of coordinate) | Using this data type combined with a longitude field will enable geo based features like a map view, navigation etc. |
Longitude | When the value of this field is a valid longitude (part of coordinate) | Using this data type combined with a latitude field will enable geo based features like a map view, navigation etc. |
Money | When the value of this field represents a price or currency related number. | Using this data type will enable mobile commerce options like combining this data with a checkout building block. |
Number | When the value of this field represents a number without the decimal sign (comma or period) | Using this data type will mark the field as a number that might come in handy when using this field for sorting purposes. |
Phone number | When the value of this field represents a phone number and the user should be able to call this number from within the app. | Using this data type will mark the field as a phone number so the user can call the phone number by tapping on it. |
Rich text | When the value of this field contains HTML formatted text. | Using this data type will mark the field as a rich text (HTML) formatted text so it can be shown accordingly. |
Text | When the value of this field contains unformatted text. | This is the default data type for every field when we couldn't recognize any other data type. |
Time | When the value of this field contains just a time. | Using this data type will mark the field as time so it can be formatted accordingly. |
Universal date and time | When the value of this field contains a UTC date and time. | Using this data type will mark the field as a date and time field, so we can format it correctly and accordingly to the user's preferences. |
URL | When the value of this field contains a URL. | Using this data type will mark this field as a URL so the user can click on it to open de URL. |
Video | When the value of this field contains a URL to a video. | Using this data type will mark this field as a URL to a video so we can enable playback of the URL. |
Yes/No | When the value of the field contains a yes/no (boolean) value. | Using this data type will mark the field as a yes/no value, this might come in handy when using it to filter. |