Hi All for the past 8 weeks i have been running a script that populates workforce with assignments from a csv published as a feature to ArcGIS online using python it worked every day until today when i was met with an error.
strptime() argument 1 must be str, not int Failed to execute (Add Assignments)
from datetime import datetime
#Append updated information
assignments = []
for feature in features:
assignments.append(
workforce.Assignment(
project,
geometry=feature.geometry,
location=feature.attributes["location"],
due_date=datetime.strptime(feature.attributes["Due_Date"], '%d/%m/%Y %H:%M:%S'),
description=feature.attributes["description"],
priority=2,
assignment_type=feature.attributes["AssignmentTXT"],
status="unassigned",
work_order_id=feature.attributes["WorkOrderReference"]
)
)
project.assignments.batch_add(assignments)
the error is relating to the date field, i have changed nothing in my script. i uploaded the csv to Arcgis online published it as a feature and then used it to populate the assignments. Prior to this the due date was always recognized as a string but today Arcgis online recognized it as a date. Why would this suddenly start happening has something change with the way a csv is published to Arcgis online. i know i can just use the date field now but i am just curious as to why all of a sudden it changed.