How to delete duplicate columns in csv files while importing data through email attachments?

div
Kilo Contributor

Hello,

I'm trying to import data through email attachments in ServiceNow. The attachment (csv) consisting of data has duplicate column names. Is there a way to delete the duplicate columns before the inbound action creates a record on the data source table. I'm not even able to test load the records from csv file because the data source throws up an error saying "table has duplicate column names". Deleting column name manually and then uploading the csv file is not an option as we are using an inbound action to import data to  automatically update records on the target table. Thanks.

 

 

Regards,

Div

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Divya,

Ideally the email attachment should not have same columns.

Why not inform the team who is sending the file to have it unique columns instead of making any change in ServiceNow

out of box you cannot do this. but even if you are trying something custom then it would take time for you to develop and it need to be robust

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Divya,

Ideally the email attachment should not have same columns.

Why not inform the team who is sending the file to have it unique columns instead of making any change in ServiceNow

out of box you cannot do this. but even if you are trying something custom then it would take time for you to develop and it need to be robust

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI,


See servicenow wont allow you to create a field which name already exists for that table. You will have to create a different column name and you can keep label same.

So make sure your table has unique column(Field) name and then upload the data. it will solve your issue.


Thanks,
Ashutosh

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Div,

Any update on this?
Can you mark my answer as correct, helpful if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.
 
Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader