Hi,
We have a workforce project, where dispatchers create assignments from a feature class within the dispatcher map. We have configured this using the pop-up so the location field is populated with relevant location info, but we'd like to populate the ID and Note Fields from other attributes in this same feature class.
I believe that this is possible using a python Notebook, but haven't been able to find any details or examples of this being done. Is this possible and does anyone have any example scripts?
Many Thanks
Hi @NRARAdmin this is definitely possible. We have a sample notebook which includes a section on creating assignments from feature layers.
You'll just need to modify this section to set the values you'd like:
crosswalk_assignments = []
for _, row in crosswalks_df.iterrows():
crosswalk_assignments.append(
workforce.Assignment(
project,
geometry=row["SHAPE"],
location=row["location"],
description=row["description"],
priority=int(row["priority"]),
assignment_type="Paint Crosswalk",
status="unassigned"
)
)
You can find documentation about the Assignment class here.