Skip to main content
Announcements
Qlik Cloud maintenance is scheduled for this weekend May 11-12. View maintenance windows per region here.

Salesforce - Upload Jobs API

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
PradeepUrala
Former Employee
Former Employee

Salesforce - Upload Jobs API

Last Update:

Apr 28, 2022 2:29:01 AM

Updated By:

PradeepUrala

Created date:

Sep 6, 2021 8:56:12 AM

Attachments

With Salesforce Jobs API, you can insert, update, upsert, or delete large data sets. Prepare a comma-separated value (CSV) file representation of the data you want to upload, create a job, upload job data, and let the Qlik Application Automation handle these with the Salesforce API.

 

Here are the steps to use the Upload Jobs APIs:

  1. Read the CSV file which needs to upload to the Salesforce Organization.
  2. Firstly, Select the Jobs tag after selecting the Salesforce connector in the right rail to list out all the blocks related to Jobs API.
    Use the "Create Bulk Upload Job" block to create a job. Select appropriate 'operation' for the job. Each 'Operation' expects a differently formatted CSV file. This block creates a job that can be used for operation.
    • insert: Make sure to have added the mandatory fields of the object.
    • delete: Only the ID of the records is required in the CSV file.
    • hardDelete: Only the ID of the records is required in the CSV file.
    • update: The ID of the records should be specified in the CSV file.
    • upsert: External ID of the record should be specified in the 'External Id Field Name' parameter of the "Create Bulk Upload Job" block and all the Mandatory fields of the record should be specified in the CSV file.
      Jobs_1.png

       

  3. Map the created job ID to the 'Upload Job data' block and upload the CSV file which was previously read in the same automation. Now run the Automation. This will upload the file to Salesforce.
    Jobs_2.PNG

     

  4. After the Upload, use the "Close or Abort Upload Job" block to mark this job as 'completed'. Note that, the upload is only processed after marking the job as "UploadComplete".
  5. We can get the result of each upload job using the following blocks:
    • "Get Upload Job Successful Record Results": Retrieves a list of successfully processed records for a completed job.
    • "Get Upload Job Failed Record Results": Retrieves a list of failed records for a completed job.
    • "Get Upload Job Unprocessed Records Results": Retrieves a list of unprocessed records for a completed job.
Tags (1)
Labels (1)
Comments
SilvioElect
Contributor
Contributor

Hello,

i've tried to make the same Automation as yours, but Salesforce seems not to be reading anything from the csv saved in dropbox.
In fact, on salesforce in the section "Bulk Data Load Jobs" I get a "Job completed" status, but no record is processed, nor failed.
Which value did you assign to the variable in this cycle?
thanks,

Silvio

PradeepUrala
Former Employee
Former Employee

Hi @SilvioElect 

The intention of this article is to give a brief and generic approach to using the Salesforce Jobs API and it is not a one-stop solution for using Jobs API. The file upload process might differ based on use cases.

I see from your comment that you might be having issues while reading and storing the CSV values in a variable. The file which you are reading from a source should be read properly with all appropriate 'mode', 'delimiter', and 'encoding' methods. As you are trying to replicate the above automation mentioned in this article, you can refer to the newly attached automation in this article. Also, you can check the status of the job using the block 'Get upload job information'.

SilvioElect
Contributor
Contributor

Hi @PradeepUrala  thank you for you answer, eventually i understood that my problem was the way qlik sense generates a csv file, it is UTF-8BOM, while salesforce requires just UTF-8 without BOM!

Now i succesfully transferred data to Salesforce, but my problem now is that i don't understand how to retrieve the list of failed jobs through the block: "Get Upload Job Failed Record Results".

Where do you see such list? The only information that i get back from that block is a JobID. what do you do next if you want to check the failed records?

thank you so much in advace.

PradeepUrala
Former Employee
Former Employee

Hi @SilvioElect 

You can use the "List upload jobs" and filter out only the 'Failed' jobs. On the other hand, the "Get Upload Job Failed Record Results" block gives information about a specific failed job. This block usually responds with the error code and salesforce ID.

 

SilvioElect
Contributor
Contributor

Hello @PradeepUrala ,

I finally managed to get the failed results, but apparently (at least from what I heard from our salesforce consultant), it is impossible to get results from the block.. because the job type is bulk V2 and with that version the csv with failed records result is not supported. So I had to use Postman and make a call in GET with the url of failed jobs using as autorization the Bearer Token (from SF).

I hope Salesforce can solve this part because it would be much easier just getting the results from the block..!

 

scottduthie
Partner Ambassador
Partner Ambassador

Hi @PradeepUrala  - thanks for the great post.

I'm actualy stuck at a pretty rudimentary step. I have a CSV saved to a space in the Qlik Cloud and this CSV contains the values I want to upload to Salesforce. What block can I use to read the CSV? I can see blocks for connecting to Cloud based sources but I can't find anythingrelated to reading a CSV (or QVD for that matter) that already lives in the Qlik Cloud.

Thanks in advance.

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @scottduthie  

I recommend posting your requirements in the Qlik Application Automation forum to make use of our active userbase and our subject matter experts who monitor the forums.

All the best,
Sonja 

prinzchristian
Partner - Contributor III
Partner - Contributor III

Hello everyone,
I have the problem that my automation also runs through and some of my rows are also transferred, but above a certain size (loop size 20,000 rows per 3 columns) I cannot find them in the Salesforce target table - there are no error messages.

Does anyone have a solution?

Thank you very much for your help! 🙂

Qlik Application Automation Qlik Cloud #Salesforce

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @prinzchristian 

Did you mean to post this in the Qlik Application Automation forum? That is where this is where you can find our active support agents and your Qlik peers!

All the best,
Sonja 

Contributors
Version history
Last update:
‎2022-04-28 02:29 AM
Updated by: