Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Update a MS SQL Server table with auto-gen'd Salesforce Id

Hi - I am a Talend novice and am trying to upload records to Salesforce, get the auto-generated Id and update the local database with that Id for each record that was selected/uploaded. I have outlined my process as follows:

 

1. Receive a file from a 3rd party

2. Stage the file in a MS SQL Server database table (Table A)

3. Read the records from Table A and insert the data into Salesforce (which auto-generates an Id value)

4. Update Table A with the newly created SF Id value

 

I cannot figure out how to get Talend to make the update in Table A. Pics of my job are attached.

 

If I can provide further clarification, please let me know and thanks in advance for your help.

 

Thanks!

Labels (4)
1 Solution

Accepted Solutions
fdenis
Master
Master

we are inline.

in tOutputXxx uncheck "field option".
check key for Recordkey. (so Talend is going to use it for update ….. where Recordkey=xxx)

View solution in original post

5 Replies
fdenis
Master
Master

I think that your recorkey is a unique id of your db table.
in output you did not need field option. you just have to set recordkey as key.
Anonymous
Not applicable
Author

Thank you for your response. I'm not sure I understand what you are saying.

 

RecordKey is the PK in my local table.

SalesforceId is the PK in the table I am inserting into in Salesforce.

 

I am passing the RecordKey value through the process so that when I get the auto-generated SalesforceId back after insert into Salesforce, I can update the local table with the corresponding SalesforceId for that row. RecordKey is what lets me map the new SalesforceId to corresponding row locally.

 

For example, if I have 1 record in my local table with RecordKey value = 1

I insert the value from that row into Salesforce and an Id of "ABC" is generated by Salesforce

I need to update the SalesforceId value in my local database table for the row where RecordKey=1 with the value "ABC"

fdenis
Master
Master

we are inline.

in tOutputXxx uncheck "field option".
check key for Recordkey. (so Talend is going to use it for update ….. where Recordkey=xxx)
Anonymous
Not applicable
Author

I appreciate your taking the time to help, but please keep in mind I have never done this before and have very minimal experience with Talend.

 

I unchecked the "Use Field Options" box on the Advanced settings tab of the tMSSqlOutput_1 component as you mentioned in your post.

 

You also mentioned "check key for Recordkey." Where? In the tMap_2? The tMap_2 component already shows the Recordkey as the PK.

 

If you could maybe provide a pic or perhaps a detailed explanation on where and how I am supposed to "check key for Recordkey", that would be very helpful.

 

Thanks!

Anonymous
Not applicable
Author

Actually, I think I got it. I did the insert and got it to update the newly generated SF Id into the local table.

 

Thank you so much for your help and patience!!