function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Udaya BhaskarUdaya Bhaskar 

Issue in Data Loader

Hi All,
 
I am trying to create accounts through Data Loader. The accounts are getting created but the account owner field is getting updated to the user id used for the operation. I am not sure why this error is encountered. I was able to load succesfully without any issues 2 days back. yesterday we did a sandbox refresh. The owner id in production and  sandbox for the users are same.
Can some one help us why this issue is encountered.
 
Regards,
Udaya
jpizzalajpizzala
By default, the Data Loader will use the id of the Salesforce account performing the upload as the object's owner.

If you want to have the object's owner be something other than the uploader's id, then specify it in the CSV file. Create a column in the CSV file to be imported labeled "Object Owner" or similar (the name doesn't matter as long as you know how to map it to the appropriate field in Salesforce) and populate with the Salesforce Ids of the appropriate owners.
Subhabrata_BasuSubhabrata_Basu
Hi,
 I was going through the solution you provided for uploading the object record owner name in salesforce other than the person uploading records using dtata loader.
One thing i will like to draw in your attention is by any means we cannot upload the record owner name using data loader. It by default takes the id of the uploader. You can check it with the recent version of apex data loader also.
Take Care.
Tahnks & Regards
Subhabrata Basu
Salesforce Level II Certified Consultant
jpizzalajpizzala
Something else you may want to consider is splitting the CSV into multiple import files. Each file would hold the files for one owner. Upon uploading with data loader, you could then go into the mass transfer object tool and search for the records added today with you as the owner and transfer them to the appropriate owner.
jpizzalajpizzala
I have Data Loader 10.0 and just performed the following Account test import in my DE:
  1. I created a CSV with 2 columns, AccountName and AccountOwner.
  2. I added 1 record with "Test Account" as the AccountName and the SFID of the second user in my DE (the one I was not logging in as with the Data Loader) as the Account Owner
  3. I chose Upsert as the import method in Data Loader
  4. I mapped AccountName from the CSV to Name in Salesforce
  5. I mapped AccountOwner from the CSV to OwnerId in Salesforce
After the import completed, I had a new Account with Test Account as the name and the non-Data Loader user as the owner.

HTH
Subhabrata_BasuSubhabrata_Basu
the one you are  talking about is upsert and mass transfer. But when you go for upload (insert)
records, there is no option in users hand to select the owner explicitely.
 
Thanks & Regards
Subhabrata Basu
Salesforce Level II Authorized Consultant
jpizzalajpizzala
Subhabrata, apparently I am misunderstanding you because I went back to the Data Loader with the same file mentioned above and in step 3 I performed an Insert instead of Upsert. The result was the same - the Account was created with the appropriate owner assigned to it.

When you say "there is no option in users hand to select the owner explicitely" do you mean that there is no way, within the Data Loader solely, to match each record to an existing Id in Salesforce? If so then, yes, the Data Loader does not provide dynamic lookup abilities in this sense. You will have to create a report in Salesforce with the Users and their SFID then copy the appropriate SFID into the CSV before uploading via Data Loader.
Subhabrata_BasuSubhabrata_Basu
ya thats true..salesforce can't lookup dynamically. And during insert only (first time insert) one cannot map the user sfid to the owner field. what you described was first you uploaded records then updated the owbner id of those records with your desired id.
jpizzalajpizzala
The OwnerId is available as a mappable field during Insert as well as Upsert in Data Loader. So you can start with a completely clean org and insert (using Data Loader) Account records in CSV format with the SFID of the appropriate owner's User record (assuming that at the very least, the User accounts have been set up).

The only time you would have to insert with Data Loader and make adjustments post-import was if you are using the Mass Transfer Records functionality. And you do not have to use the Mass Transfer Records functionality if you are able to map the owner correctly in the CSV upon initial import.

I apologize for posting about the Mass Transfer Records as this has apparently caused some confusion. The Mass Transfer Records method is completely independent of the Data Loader approach.

I hope this clears things up.
Subhabrata_BasuSubhabrata_Basu
no one cannot map record owner field via data loader during insert. i will request you to check with this once again.
jpizzalajpizzala
Here are the contents of my SDL file (the mappings file you create using the Data Loader):


Code:
#Mapping values
#Wed Apr 02 14:27:21 PDT 2008
AccountOwner=OwnerId
AccountName=Name
 
You can see that AccountOwner from the CSV file is mapped to the OwnerId field in Salesforce.
BoopathyBoopathy

Hi Subhabrata,

I hope what you are telling is absolutely correct!! Can you please let me know then how to use owner id field that is available during creating mapping.How a different owner id can be given in a mapping?? How can we refer new owners id??

 

Regards,

Boopathy

Subhabrata_BasuSubhabrata_Basu

sorry guys...specially to jpizzala................actually i was just messed up with owner id and created by id.....one can easily choose different owner id(which is a reference).....during uploading data.............................actually one cannot manipulate the create by id.......so i just made up a mess.....as that was the thing i was trying to figure out in my existing project....

cheers mate

Subhabrata_BasuSubhabrata_Basu
again to you boopathy.................first you extract the csv containing salesforce userid and user name.......now when you upload data ... say for example for account.....just map the owner id (not the owner name, as the reference in salesforce is done via unique salesforce id.......), wherever which name required from the previous .csv you exported....hope this will help you.......if you need any further information, please let me know,.....
BoopathyBoopathy
Thanks Subhabrata,
 
So Only Owner of the respective Object(Account or lead) can alone be changes using the owner id in the mapping ,there is no way to change the Created by field(??).Created by field will be the userid used to login salesforce!!!
 
Regards,
Boopathy
SimbaSimba
I was going thru the chain of messages regarding assigning OwnerId to the data getting loaded thru Data Loader.

From what I unnderstand, reading your suggestion, you have mentioned about creating a csv file with the userId and user name and then import Account information from this other csv file, somehow matching the ownerId with this userid. This last part I did not get, how can you do that.

So basically what we are saying here is that there are two csv files, one with UserName and UserId (User.csv), link and the other which has Account information with probably the UserName (account.csv). How can we have two csv files as the input to the data loader.

I know we can call them one after the other. But in my case there can be more than one rows in the account.csv for a given user, and the User.csv file will have only one ocurrence of a given User. I get an error in the dataloader when I try to upload the OwnerId with User Id from the User.csv, since there are more than one row for a user name.

Please let me know if you have any suggestion.

Thanks

Warm Regards

Swati.




jpizzalajpizzala
All Account record information can be in a single CSV file.  If you have the record owner's name from a previous system in this CSV file, you will have to replace all instances of each record owner's name with their Salesforce User record ID before importing.  Then, you can map this field to the OwnerId field in Salesforce using the Data Loader mapping screen.

HTH
SimbaSimba
Thanks for replying, I truly appreciate the response.

We need to do this through command line/ batch process on a daily process. Is there a way to somehow merge the two files and update the Names with the User Id in the Account.csv file from the User.csv file.

Thanks

Regards

Swati




jpizzalajpizzala
The data loader won't do the CSV file merging for you, but you could use a relational database to do it (Access, SQLServer, Postgre, etc).  Import both of the CSV files into the database, match on the user name (or whichever field necessary) and output via a SQL view, which can be exported to CSV format.