External ID Mapping from a CSV File

  • 28Views
  • Last Post 3 weeks ago
  • Topic Is Solved
0
votes
Dan Hardy posted this 4 weeks ago

Hi-

I am importing a CSV file to a custom object in Salesforce.  This object has a parent where I do not know the Salesforce ID, so I am using the parent's External ID instead.  Is it possible to map this external ID to an expression?  The expression is concatenating 2 fields in the CSV file - Project & Period.  How do I do this?

Thanks!

Dan

Order By: Standard | Newest | Votes
0
votes
Dmitriy Muzurov posted this 4 weeks ago

Hello Dan,

Thank you for contacting our Skyvia Team.

It is possible to map an external ID field with an expression.

For simple concatenation of two fields, you can use this expression:

[Project]+[Period]

Should you have any questions, do not hesitate to contact us back.

0
votes
Dan Hardy posted this 3 weeks ago

Thanks for getting back to me.

I tried using an expression (see below) and I got an error message "MTB Period: id value of incorrect type:" I expect this wasExpression snapshot

because Salesforce was looking for the Salesforce ID and not the external ID.  However, when I try to use the External ID mapping option, I do not have the option of typing in an expression.  What am I doing wrong?

External ID snapshot

 

0
votes
Dmitriy Muzurov posted this 3 weeks ago

Dear Dan,

Thank you for the screenshots.

When you select "Use External ID" option you need to select the the field that would perform a function of actual external ID:

Then, on the mapping page this field becomes mandatory for mapping and can be mapped with an expression.

For your package ID 79954, MTB_Period__c field is mapped with this expression, however another field is selected for external ID - Composite_External_ID__c.

Should you have any questions, do not hesitate to contact us back.

0
votes
Dan Hardy posted this 3 weeks ago

Hi-

Thanks for getting back to me.  I see the problem now.  I need the field "Composite_External_ID__c" so Skyvia will find existing instances of the record and update them rather than inserting new ones.  I need a way to lookup this record's parent using an External ID field using an expression.  Is that possible? 

  • The field below is the external ID I'm checking for the upsert.
  • The field with the arrow is the one I don't have an foreign ID for, but would like to look up using the parent's external ID

 

 

0
votes
Dan Hardy posted this 3 weeks ago

To add to what I said above, here is how I would do an upsert in Salesforce Dataloader to use the parent external ID field instead of the Salesforce ID field:

0
votes
Dmitriy Muzurov posted this 3 weeks ago

Dear Dan,

Thank you for getting back to us.

A field which is a foreign key can be looked up with a target lookup of a parent object, however it is not possible to use an expression in the lookup.

More details about lookup can be found here.

Should you have any questions, do not hesitate to contact us back.

0
votes
Dan Hardy posted this 3 weeks ago

Thanks very much for your help.  I was going down the wrong path.  You're right, I can use Composite Lookup Key. 

0
votes
Dmitriy Muzurov posted this 3 weeks ago

Dear Dan,

You are very welcome.

We are looking forward to hearing from you, should you require any further assistance.

Close