Invalid assignment type with ArcGIS Notebook

98
2
Jump to solution
08-17-2022 02:43 PM
David
by Esri Contributor
Esri Contributor

Why am I receiving the invalid assignment type error?

I am using the ArcGIS Notebooks supplied on GitHub to add assignments to a Workforce project via CSV. 

I used the sample csv and added a field called assignment_type to store the GUID for each assignment. 

When I upload the CSV, I received ValidationError: Invalid Assignment Type

The CSV successfully loads

CSVLoaded.png

I've updated the Notebook to retrieve the assignment_type just like the other columns. 

ErrorMessage.png

I've even tried assignmenttype (which is the actual field name in the assignments layer)

Thanks for your help. 

0 Kudos
1 Solution

Accepted Solutions
graeme_hill
New Contributor III

Hi David,

I think with new workforce projects the api requires the assignment description not the globalid (the first workforce version was the id number). Hopefully the Description column in your df is the correct description for your workforce project making your fix pretty simple change row["assignment_type"] to row["Description"], otherwise you can get the assignment description text from the assignment table.

Hope that helps.

Cheers, Graeme

Cheers, Graeme

View solution in original post

2 Replies
graeme_hill
New Contributor III

Hi David,

I think with new workforce projects the api requires the assignment description not the globalid (the first workforce version was the id number). Hopefully the Description column in your df is the correct description for your workforce project making your fix pretty simple change row["assignment_type"] to row["Description"], otherwise you can get the assignment description text from the assignment table.

Hope that helps.

Cheers, Graeme

Cheers, Graeme
David
by Esri Contributor
Esri Contributor

That was it! 

I thought since the assignment_type field stored the GUID that I had to feed it the actual GUID. Using  assignment_type=row["Description"] worked! Thank you very much. 

0 Kudos