Receiving "Create replica internal error." when using multi-sheet excel to append feature layer.

1061
1
10-28-2020 10:46 PM
VictorZhou1
New Contributor II

Hi everyone,

I've encountered an issue with my python script:

The script uses an excel file to update attributes of map objects in feature layers on Esri Online.

It gives an error if the excel has multi sheets. (I believe it has something to do with the combination of column headers and the number of sheets.)

Error Msg: 

Unable to append data.
Create replica internal error.

Detailed Msg:

What the script does:

Uploads Excel to ESRI Online

Analyse Excel file

   Source = gis.content.analyze(item= uploaded_item.id, file_type ='excel'

Grabs ID of layer to be updated

Update attributes using append (Error occurs here)

      Lyr_to_Update.append(item_id=uploaded_item.id,
upload_format = 'excel',
source_table_name = "test_points_0",
field_mappings = [{"name":"FID", "source":"FID"},
{"name":"x", "source":"x"},
{"name":"y", "source":"y"}
],
source_info = source['publishParameters'],
upsert=True,
update_geometry=True,
append_fields=["FID"],
skip_inserts=True,
upsert_matching_field="FID") 

Append will work fine if I change Analyse Excel file from:

   Source = gis.content.analyze(item= uploaded_item.id, file_type ='excel'

to:

   Source = gis.content.analyze(item= uploaded_item.id, file_type ='microsoft excel'

Changing the file_type to microsoft excel however will prevent the coordinates from being updated.

(looking at the output for analyze source, the excel file is being read as a csv for some reason.)

0 Kudos
1 Reply
VictorZhou1
New Contributor II

Update:

In case anyone have this problem as well.

This is part of a bug:
#BUG-000135035

Workaround:

"Cutting the data to be into smaller parts (depending on the data) allow the smaller parts to be successfully appended to the targeted layer."

 

0 Kudos