Find your content:

Search form

You are here

Salesforce data upload - Can I upsert with the Data Loader using different fields for existing and new records?

 
Share

I have an object, Financial Account, that exists in Salesforce. The object is updated twice every week from our accounting system so that Salesforce reflects up-to-date balances for the accounts. Every account must be linked to a Client record in Salesforce, but this connection does not exist in the accounting system. Right now I bring the data from the accounting system into Excel and run a macro that creates two CSV files, one for updating existing accounts and one for inserting new accounts, then use the data loader to import the data in two separate imports (an update and an insert).

I would like to replace these two steps with a single Upsert step, however, I'm stuck on one point. Currently, my 'update' CSV and my 'insert' CSV have different fields b/c while 'update' only needs the record ID and the current account value, in order to insert a new record it is also necessary to provide the account's name and the Client to which the account is linked (both of these are already in the system for the updates). Can I run an upsert where the new records have these fields populated but the existing records do not (and the updates' fields are not overwritten with blank values)? I know that I can just populate all of the existing records' 'Account Name' fields from the accounting system, however, the related Client information does not exist in the accounting system, only in Salesforce.

I'm not sure if I'm asking my question clearly, but what I'm really trying to get at is: Can I include existing and new records in an Upsert where the new records include more field data than the existing records, and those fields on the existing records are not over-written with blank values?

Thanks!


Attribution to: jackerman09

Possible Suggestion/Solution #1

I haven't tried this, but according to this site: http://www.interactiveties.com/b_bulk_api_nulls.php

If you use blank values (not #N/A) for the fields in the spread sheet pertaining to updates, then the fields should not get updated for the update records.

If you use this in conjunction with an upsert based on either the id or an external id, then that should help you out.


Attribution to: James Loghry

Possible Suggestion/Solution #2

Have a look at the (free) starter edition of Skyvva this takes a little bit of time to get used to but has some fantastic functionality including

  1. IF statements (we use an if statement that does the lookup and if found use the data in salesforce otherwise use the data in the file to solve the same problem you have).
  2. VLOOKUPS (very similar to Excel)
  3. Chained Interfaces (Upsert Accounts and Contacts using the same file and single load)
  4. Error Handling via Message Board

If you then want to upgrade to their advanced version to be able to schedule it via a small java application then it is easy to reuse the manual load templates.

To get the FREE Starter Edition Now, Just register in the SKYVVA Customer Portal.


Attribution to: Jason Lawrence
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/1539

My Block Status

My Block Content