Backendless Support
 
Answered

Importing Data with GeoPoint Relationship Not Working

Good morning,

App Id: C25CB2C7-149D-F6DC-FF86-AEE62D080B00

I've imported GeoPoints and am now importing my Organization table that has a relationship back to my geopoints. The import is successful but if doesn't have my relationship to my geopoints. Attached is the Organization file I'm using for the import.

Thanks,

Dan

Best Answer
photo

Hi, Dan.

You have wrong format of your csv file.

Here some requirements:

1) Every row except first - is the data row.

2) Every column record must be enclosed in double quotes.

3) Every column without record must be as "null" value (but without double quotes)

Example for the first data row (do not forget to change objectIds):

  1. "objectId(STRING_ID)","name(STRING)","address(STRING)","city(STRING)","state(STRING)","zipcode(STRING)","county(STRING)","timezone(STRING)","dst(STRING)","phone(STRING)","type(STRING)","year(STRING)","designer(STRING)","location__GeoPoint__bcklsFK__ONE_TO_ONE"
  2. "8BEB9B6A-6024-0DB0-8EB9-8E77B3002DDE","Acme & District Golf Club","Hwy 791","Acme","AB","T0M 0A0",null,"MST","U","(403) 546-4020","Semi-private","1960","N/A","43D335F2-097D-F37C-FF7D-EECF1E64F500"

Leave a Comment

Comments (9)

photo
1

Hi Dan

Could you please describe the steps of how you exported and then imported data?

In order to export (and then import) data with relations correctly - corresponding checkboxes should be selected, see the screenshot. I would recommend to import file as a zip, not every file one by one. Please let us know the results.

Best regards

photo
1

Hello,

So I'm importing new data (meaning I'm not exporting and then importing). I have one master file that I split into two files. The parent is the Organization file and the child is the GeoPoint file. Before I split the master file into two files I first generate a GUID that serves as the OBJECTID of the GeoPoints file and the location column of the Organization file (this is essentially the foreign key). The GeoPoints file loads perfectly. The Organization file also loads, however, the location column is null...so basically the link or foreign key isn't being loaded.

Thanks,

Dan

photo
1

Hello,

top of Organization.csv is

  1. objectid(STRING_ID),name(STRING),address(STRING),city(STRING),state(STRING),zipcode(STRING),county(STRING),timezone(STRING),dst(STRING),phone(STRING),type(STRING),year(STRING),designer(STRING),location__GeoPoint__bcklsFK__ONE_TO_ONE

try with this one:

"objectId(STRING_ID)","name(STRING)","address(STRING)","city(STRING)","state(STRING)","zipcode(STRING)","county(STRING)","timezone(STRING)","dst(STRING)","phone(STRING)","type(STRING)","year(STRING)","designer(STRING)","location__GeoPoint__bcklsFK__ONE_TO_ONE"

photo
1

I have changed your file, it is attached

photo
1

Hi,

Thanks. The file you provided didn't have the double quotes (that I saw). So I added them myself but the import failed due to the double quotes.

Invalid parameter "objectId(STRING_ID)" . Names can only contain alphanumeric and underscore characters..

photo
1

Have you tried importing the file Sergey provided as is? I opened that file in a simple editor (not Excel or smth) and the double quotes are there - you shouldn't add them.

photo
1

Hi Guys,

I imported the file as given but it still didn't load the location column. Any ideas?

Thanks,

Dan

photo
photo
1

Hi, Dan.

You have wrong format of your csv file.

Here some requirements:

1) Every row except first - is the data row.

2) Every column record must be enclosed in double quotes.

3) Every column without record must be as "null" value (but without double quotes)

Example for the first data row (do not forget to change objectIds):

  1. "objectId(STRING_ID)","name(STRING)","address(STRING)","city(STRING)","state(STRING)","zipcode(STRING)","county(STRING)","timezone(STRING)","dst(STRING)","phone(STRING)","type(STRING)","year(STRING)","designer(STRING)","location__GeoPoint__bcklsFK__ONE_TO_ONE"
  2. "8BEB9B6A-6024-0DB0-8EB9-8E77B3002DDE","Acme & District Golf Club","Hwy 791","Acme","AB","T0M 0A0",null,"MST","U","(403) 546-4020","Semi-private","1960","N/A","43D335F2-097D-F37C-FF7D-EECF1E64F500"

photo
1

Hi Oleg,

This worked perfect.

Thanks,

Dan

photo