Bulk Create doesn't accept spaces or dots

Hi,

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.

For me I managed to get it to work. :grinning:

Hi @Jeroen_Bruinsma and welcome to the Losant Forums.

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.

Hi Dylan,

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.

Have a nice day!

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.

1 Like

Hi Dylan,

You are right… I think it went wrong in me changing the semicolons into commas. All works fine if you wrap gps locations or ip addresses into double quotes and use comma’s as separators.

So the only suggestion of my bugfix what is left is changing the preview:

If you upload this file:


The preview accepts the semicolon as a separator,

This is the error you see:

Thanks for helping out!

You’re absolutely right. I will file this bug ticket to also not allow semi-colons as delimiters in the user interface. Thanks again for bringing this to our attention.