You need to include objectId
into the CSV and reference that value in the relations. The value of objectId
can be your own (must be unique). This is what we show in the documentation as well. That’s the only way Backendless will understand that the objects are related.
@mark-piller
one more question
how can i reference a table when i import geo points?
objectid,lat,lon,categories,meta <= how to reference a data table here.
@mohammad_altoiher, please see the instructions below:
- Create a CSV file called `GeoPoint.csv’. The file must have the following “columns”:
"id(STRING_ID)","latitude(DOUBLE)","longitude(DOUBLE)","category(STRING(null))","metadata(STRING(null))"
- The file should contain all your geopoints. The first column is the ID of each geopoint - a unique string which identifies it in the system. For example:
"00BBD804-73EC-065E-FF38-BEA2A9C4A000",43.0389,-87.90647,"geoservice_sample","city=MILWAUKEE"
"011EF8F9-6CD5-82AF-FF96-F4445D520300",62.13246,9.9968,"geoservice_sample","city=FOLLDAL"
"018ECC0E-9752-D43E-FF9F-DBE906C0AE00",37.21533,-93.29824,"geoservice_sample","city=SPRINGFIELD"
"01C476CF-BEC1-1C2C-FF53-06D7BBA15800",10.16028,-68.895,"geoservice_sample","city=CHIVACOA"
"01CB84C9-A636-28A7-FFAF-E082D8489000",40.18111,44.51361,"geoservice_sample","city=YEREVAN"
"02DCD56A-39FD-8BBD-FF63-3ED73BB15300",37.31917,-122.27417,"geoservice_sample","city=LA HONDA"
- Suppose your geopoint references an object from table
Address
and the name of the metadata property isaddress
. In this case, in your Address.csv you need to declare the following column:
address__GeoPoint__bcklsFK__ONE_TO_MANY
- The value for that column should be
id
of the corresponding geopoint.
Hope this helps.
Regards,
Mark
this did not work on the import for the address table. ONE_TO_ONE work.
I didn’t quite understand what you wrote. However, the best way to learn how to format the data is to enter the data using Backendless console, create all the relationships and then run export to see how Backendless itself creates those CSVs. Then if you structure your CSVs the same way and import, it will work.
i did that and the geo point meta is empty
25.8889775-45.3576753,25.8889775,“45.3576753”,“stores”,“”
and this how it look in the console
You are looking in the wrong place. When you export data, the relation will be declared in the store
CSV.
so in store.csv if i declare the column
location__GeoPoint__bcklsFK__ONE_TO_ONE
i will see the metadata as in this picture for the geo point above?
If you also include GeoPoint.csv which has the referenced geopoint, then yes, you should.
i tried a lot of times with no luck there is no metadata in geo point.
here is the test files. tell me what is wrong.
store1.csv (77 Bytes)
location.csv (40 Bytes)
Where is Geopoint.csv
?
its the location.csv
The file with all the geopoints must be called GeoPoint.csv.
it does import even if the file not named GeoPoint.csv
however i did try after renaming and its the same.
Put all the files together into a zip and upload here so we can check.
what should it be? im doing it as i see on step one. them meta is empty because i have no idea how to refer to a table from here.
locationn,25.8889775,45.3576753,“stores”,“”
The first line of GeoPoint.csv
must have the following:
"id(STRING_ID)","latitude(DOUBLE)","longitude(DOUBLE)","category(STRING(null))","metadata(STRING(null))"
Here’s a working zip. The data is imported properly, however, the metadata for the geopoint doesn’t show up unless you add another metadata property. This is a display issue, we will fix that one. However, from the API perspective, it works just fine for the data retrieval.
Archive.zip (1.3 KB)