How do I specify the key when connecting Salesforce to a MySQL in an Integration?

  • 162Views
  • Last Post 15 June 2017
0
votes
michael posted this 02 June 2017

I'm trying to create an integration to copy data from one Salesforce object (Contact) to a MySQL database table. I have created the connection, but never had the opportunity to specify the key that would allow the system to know which records go with each other (particularly important the first time...) In the GUI to map fields from one system to the other I don't even see the Id field in the list of Salesforce fields, nor the MySQL unique key field.

Order By: Standard | Newest | Votes
0
votes
Mariia Zaharova posted this 06 June 2017

Could you please describe the scenario you want to implement in more details, for example, specify the package you are using (import, replication, etc.), the definition of your MySQL table, etc.

0
votes
michael posted this 06 June 2017

I'm trying to implement a sync package. So far I've begun to set it up and tried to test one direction (Salesforce to MySQL). I've linked all the fields. But when I try to run it, I get the error "Duplicate entry '1' for key 'PRIMARY'" There's no opportunity anywhere to specify which of the fields should be the key. And there doesn't seem to be a way to see the Salesforce ID field, which I would want to use as a unique key. I have a field in Salesforce to hold the external ID from the MySQL table. But that field in MySQL is all blank to begin with, as my first test is to import FROM Salesforce TO MySQL.

I'm sorry, I don't know what you mean by "the definition of your MySQL table," so I can't answer that question.

0
votes
Mariia Zaharova posted this 07 June 2017

The main requirement for synchronizing database data is that the primary key columns of the database tables must be autogenerated.

 

When performing synchronization repeatedly, Skyvia synchronizes only data that was changed since the previous synchronization. It uses the fields storing information about when a record was created and modified in cloud applications and creates special tracking tables and triggers in relational databases for data modification tracking.

Please refer to: 

https://skyvia.com/resources/docs/index.html?synchronization_overview.htm

https://skyvia.com/resources/docs/index.html?synchronizing_product_data.htm

Thus, you should have an autogenerated primary key in your database table in order to perform synchronization correctly.

Please tell us if this information helps.

0
votes
michael posted this 14 June 2017

I know I've let this sit for a few days. But No, this information did not help. Is there some way I could arrange a screenshare or phone call with someone to help me set up my first test sync?

0
votes
Mariia Zaharova posted this 15 June 2017

If we understood you correctly, you want to specify some key column in order to allow the system to know which record in one source corresponds to which record in the opposite source. Unfortunately, at the moment, it is impossible to specify any key for mapping existing records in the synchronized sources to each other for the first synchronization.

When synchronization is performed for the first time, it does not check whether the records in sources are identical and simply copies data from one side to another and vice versa, and "maps" the original records to their copies in another source. 

When performing synchronization repeatedly, Skyvia synchronizes only data that was changed since the previous synchronization. It uses the fields storing information about when a record was created and modified in cloud applications and creates special tracking tables and triggers in relational databases for data modification tracking.

Please refer to: 

https://skyvia.com/resources/docs/index.html?synchronization_overview.htm

https://skyvia.com/resources/docs/index.html?synchronizing_product_data.htm

 

If you are still interested in the online discussion, please let us know. 

Close