append CSV data to hosted table

302
0
09-20-2022 06:50 AM
lubhat
by
New Contributor

Hi, I have a problem to append the csv data to the hosted table. My script looks like this:

csv_item = gis.content.get('***csv_item_uid***')
analyzed = gis.content.analyze(item="***csv_item_uid***", file_type='csv')
csv_publish_parameters = analyzed['publishParameters']

feature = gis.content.get('***Table_layer_uid***')
table = feature.tables[0]
table.append(item_id='***csv_item_uid***', upload_format='csv', field_mappings=[{"name":"date", "sourceName":"date"},
                                                                                {"name":"person_in","sourceName":"person_in"},
                                                                                {"name":"person_out","sourceName":"person_out"},
                                                                                {"name":"bicycle_in","sourceName":"bicycle_in"},
                                                                                {"name":"bicycle_out","sourceName":"bicycle_out"}], source_info=csv_publish_parameters)

 It finish with "True", but it won't add any data to the table from csv.  Any ideas?

Tags (4)
0 Kudos
0 Replies