web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Retain Leading zeros at the time of importing data into Dynamics CRM

(0) ShareShare
ReportReport
Posted on by 397

Hi,

I am trying to import around 50000 records that have 3 columns that contains leading zeros and other two columns have few single quotes in name column. Single quotes are repeated in the name column. 

I am trying to import these with single shot but facing below problem.

Leading zeros are not retained when tried with excel import then i converted this to .txt file but facing error because of single quotes in name column. 

I have work around to import by writing a small component by checking the length and append the zeros through console app after importing the data through spread sheet but i am looking for a better approach through import.

I guess we can achieve this through XML import but unable to figure out how to prepare the XML file for my custom entity. Can any one suggest if we have any better approach. I am using 2016 CRM online.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi SVN,

    proceed as follows:

    1) prepend to all zeros a strange character like § or | (pipe)

    2) save excel into csv format with utf-8 encoding

    3) open csv saved file and replace the strange charcter used (§ or |) with empty

    4) upload csv

    5) you are done! :-)

    Hope it helps!

    If you found the answer helpful, please mark as Verified 

    Join my network on LinkedIn      Follow me on Twitter 

    Thank You & Best Regards

    Francesco Picchi

    Microsoft Dynamics CRM Consultant, Bologna+Milano, ITALY

    Independent Contractor

    http://www.francescopicchi.com

  • ashlega Profile Picture
    34,477 on at

    Hi,

     What is the data type of those attributes in Dynamics?

     I think leading zeroes should be retained for text fields and they won't be retained for the numeric fields.

  • Suggested answer
    Syed Ibrahim Profile Picture
    6,257 on at

    As alex rightly pointed , Unless the field is String we cant retain leading zero.

  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    If all else fails, you can always use SSIS with Kingswaysoft to import your file (from Visual Studio).

    Should not take you very long to create a package.

    You can clean your data as part of the import process if necessary.

    Hope this helps.

  • ashlega Profile Picture
    34,477 on at

    But even Kingsway won't help if it's a whole number:))

  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Of course not. Thanks. Should have added that.

    That is in case the data types in CRM are the correct data types.

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi SVN,

    if you solved the problem thanks to an answer, please mark it as verified to encourage the community to provide more and more a better support. Thank you. Francesco

    If you found the answer helpful, please mark as Verified 

    Join my network on LinkedIn      Follow me on Twitter 

    Thank You & Best Regards

    Francesco Picchi

    Microsoft Dynamics CRM Consultant, Bologna+Milano, ITALY

    Independent Contractor

    http://www.francescopicchi.com

  • Suggested answer
    Srini20 Profile Picture
    397 on at

    Thanks every one. I was away for some time. I tried a different approach by converting the excel into .xml and then copied all my spread sheet content into each column. That worked.

  • Suggested answer
    Srini20 Profile Picture
    397 on at

    Thank you, this works i guess but i tried the approach that i mentioned above.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans