[SalesForce] upsert with the Data Loader using different fields for existing and new records

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!

Best Answer

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.

Related Topic