Hi all,
I'm trying to import a very simple CSV file of workers in Workforce. When I try to import my CSV which has the same headers as the template CSV file, or even when I try to add new rows to the template CSV file, I get an error that says "Not as many fields as field headers". Has anyone had this problem before/can anyone give me feedback.
Here's a screenshot of the csv I have tried to upload
Thank you all!
Solved! Go to Solution.
Closing the loop from the DM with @OznurGeze ; opening the csv in Excel can insert an empty row at the bottom of the file. By using Notepad (for Windows) this is avoided and the csv can be uploaded.
I would say it is because of the comma in the Truck Driver, Night Shift cell. A CSV by default uses commas to separate the columns. The comma in this cell is causing is to split into another column, thereby creating another column for that row.
You would need to add double quotation marks to escape the comma so it would look like this:
"Truck Driver, Night Shift"
Greetings,
The first two rows actually came with the sample template. I did however try to delete the comma and still got the same error unfortunately. Although I am able to reupload their exact template with no errors but that ruins the point of using a csv to upload workers if I can't actually add workers.
Would you be able to share your CSV file? I can have a quick look.
Thanks for the file.
The error does not match what is the issue. The issue is the empty last line in the CSV file. Remove that empty row and you will be able to import the CSV file to add the users.
@julian_svcs i tried this solution, but it still not working, any other recommendation?
@ISDEsriNeA Can you make you CSV file available so I can see what the issue could be. Thanks
@ISDEsriNeA @SharitaU the issue is as @julian_svcs mentions, there is a trailing empty row in the csv file - this is bug in the template that we've addressed but older versions of the template file still exist.
Removing the trailing empty line will address the issue and allow the import verification to proceed. I've attached an edited version of the csv that @SharitaU first posted.
@ISDEsriNeA when you mention it is still not working, can you clarify? Does it fail with an error and if so, what is that? As @julian_svcs mentions, if you can, uploading the csv will help to quickly diagnose the issue.