Efficient Date and DateTime Management: Data Loader Best Practices

Efficient Date and DateTime Management: Data Loader Best Practices

EFFICIENT DATE AND DATETIME MANAGEMENT: DATA LOADER BEST PRACTICES

A Little Bit About Salesforce And Data Loader:

Salesforce is a CRM and deals with lots of data, we use different objects to hold different types of data. Database tables store data So while working on data you need to be careful because a small amount of change in data can cause large problems.
Data loader gets used when we want to migrate large amounts of data to salesforce org when you need to load 50,000 to 5,000,000 records. Data Loader is supported for loads of up to 5 million records. If you need to load more than 5 million records. All of the information given above is general information about data loaders but here we go for our main point for which we have written this blog.

Problem With Date and Date Time:

Date and DateTime are the data types that come up with different formats e.g. mm/dd/yyyy, dd/mm/yyyy, etc. Sometimes this creates ambiguity for the system to understand the exact date to pick. When you change the date format from let’s suppose dd/mm/yyyy to mm-dd-yyyy so then data may be come up with the issue of converting date to month or vice versa, this happens rarely. Also while working with time you need to take care of one more crucial thing i.e. Timezone. For different regions, we have different time zones that may again cause differences in data.

Date and Time Formatting :

  • When you migrate data to Salesforce org please make sure you are using the exact date and time format as your Salesforce org is using.
  • Check it in your company settings.
  • Also make sure your data loader uses the same format as your Salesforce org is using.
  • To check and change settings in the data loader follow the steps -In the data, loader navigate to settings and you will find some options like Use European date format (dd/mm/yyyy).

Timezone Handling:

  • When you are working on a Salesforce org that has a different timezone than your local timezone, then make the tool you are using use the same timezone that Salesforce has.
  • When you use the data loader tool to migrate data in Salesforce by default it will take your local timezone but in Salesforce we have another timezone.
  • Suppose in salesforce org you have set the timezone as PST (GMT-07:00) but when working you are working in IST i.e. your local timezone.
  • So what’s now, you have two different time zones so when you push data to salesforce org salesforce converts data from one timezone to another.
  • You have entered the date as 24-09-2018 and pushed data so it will be converted to PST and it will be -13:30 hours so it will be dated as 23-09-2018.
  • Here we lose the data as it is showing the difference of one day.
  • With DateTime it becomes more worse, as you got to know when we migrate data using one timezone to another timezone conversion takes place.
  • Consider a scenario where you have all your data on events that are scheduled for the next few days and this data is present in an Excel sheet.
  • Now you want to create an event or task from that data in salesforce org.
  • When you load data to salesforce org, the date and time will be converted from the local time zone i.e. IST to salesforce timezone (PST).
  • If you have intended to create the event at 2 PM on 14-09-2018 then it will create an event at 1:30 AM 14-09-2018 which is a huge difference.
  • So due to this you may lose your data and create problems.

Prevent This Problem While Migrating Data:

  • When you migrate data of data type datetime make sure your data loader is set to the same timezone as your salesforce org has.
  • By default, the data loader is set to your local timezone.
  • To check or change the timezone do the following steps: In the data loader navigate to settings by clicking the settings menu from the menu bar.
  • Here you can select a target timezone and specify the same time zone as in salesforce org.

Conclusion:

While dealing with data migration of date and date time there can be ambiguity of various things like date and datetime format, and timezone. But we can prevent this with some settings and proper formatting of date and date time.