Today I was playing with the bulk create of devices. Something I found frustrating is that my csv files seems to be accepted in the upload step, but after clicking on “Bulk create devices” I ran into multiple errors.
I managed to figure out that:
only comma separated csv files are accepted
dots in tags aren’t accepted
spaces aren’t accepted in tags
double quotes aren’t accepted in tags
With other words: the regex expression checking field values in the creation step is different than the one in the upload step.
If you look at the top of the tag inputs for a single device (the “Properties” tab after selecting a device), you will see the following line of text:
Keys may only contain uppercase letters, lowercase letters, numbers, underscores (_) or hyphens (-).
This is true for all device tags, including those added through bulk device creation. (Tag values, however, may contain other characters.) My guess is we are not validating those columns on CSV upload. I will file a ticket with the platform engineers to see if we can improve that validation prior to accepting the file. Thanks for bringing this to our attention.
Thanks for your reply. You are right, the keys are were fine in my case, they just need to be comma separated. The values however aren’t parsed correctly. Fields containing an gps location or an ip address are causing errors.
Do the values have quotes around them? GPS values often have commas within them, and if those are not wrapped in quotes, the CSV parser will think that the comma is designating a new column.
If you have Excel or Numbers or some other program that can visualize CSV data in table form, I recommend opening your file in there and seeing if everything lines up as expected. You can then adjust the settings of the file and re-export it to ensure the values are escaped / quoted.