1

I am trying to read location type data from Cloudant into Mobile App Builder (MAB). It looks like MAB is unable to parse it. If I manually create the column still is unable to match it with the data coming from Cloudant

{ "_id": "d07165c0087a05b8ae732266dc37f106", "_rev": "8-76f0947057bf237bc897adc20f838ce9", "Name": "Morrisville Location", "Address": "87 Peste Drive", "Phone": "919-278-1122", "Email": "morrisville@store.com", "Location": { "Latitude": "35.808514", "Longitude": "-78.812794" } }

What format should I use for location data so MAB can parse it ?

Jorge
  • 25
  • 6
  • 1
    Possible duplicate of [IBM mobile app builder does not see documents in Cloudant database, why?](http://stackoverflow.com/questions/37119293/ibm-mobile-app-builder-does-not-see-documents-in-cloudant-database-why) – Dave Cariello Jun 16 '16 at 15:49

3 Answers3

1

The following worked for me:

{
  "_id": "d07165c0087a05b8ae732266dc37f106",
  "_rev": "8-76f0947057bf237bc897adc20f838ce9",
  "Name": "Morrisville Location",
  "Address": "87 Peste Drive",
  "Phone": "919-278-1122",
  "Email": "morrisville@store.com",
  "Location": {
    "type": "Point",
    "coordinates": [-78.812794, 35.808514]
  }
}

Note: Order in coordinates array is [longitude, latitude]

Reference: https://docs.cloudant.com/geo.html and http://geojson.org/geojson-spec.html#appendix-a-geometry-examples

0

This very first experimental version of Mobile App Builder does not support nested objects at this time.

Here, I've removed the nested object and it works: enter image description here

See: IBM mobile app builder does not see documents in Cloudant database, why?

Community
  • 1
  • 1
joe
  • 2,468
  • 2
  • 12
  • 19
  • OK, I get that. But sending Latitude and Longitude as first level entities as shown below still MAB is unable to parse that as an object type = Location. { "_id": "d07165c0087a05b8ae732266dc37f106", "_rev": "8-76f0947057bf237bc897adc20f838ce9", "Name": "Morrisville Location", "Address": "87 Peste Drive", "Phone": "919-278-1122", "Email": "morrisville@store.com", "Latitude": "35.808514", "Longitude": "-78.812794" } – Jorge Jun 17 '16 at 14:38
  • For this first *early* version, Mobile App Builder will not be able to parse that object type because it's nested. I've updated the answer to show a picture of removing the Location and putting the Latitude and Longitude in the first level, and it works correctly. We are working very hard at improving Mobile App Builder and making it an integral piece of the Bluemix Mobile experience. – joe Jun 19 '16 at 23:47
  • Thanks for following this up. But the fact that is able to parse two decimal numbers as first level objects does not mean that the tool is able to create a complex object of the predefined type "Location" that can be used with the map page wizard. The map page wizard is expecting objects of type "Location" in order to work properly. I just want to point this out to clarify the answer. – Jorge Jun 20 '16 at 15:02
0

To answer my own question: This is not possible today given the limited parsing features of the current tool. Thanks for the comments and feedback.

Jorge
  • 25
  • 6