How do I set up the Salesforce Bulk API to load records into Salesforce?

Hello,

I am a little new and am hoping to use the Salesforce Bulk API activity in Studio but I am confused about the setup. I have checked the documentation, but it does not provide any examples and I have also not been able to find a video that shows how to set up or use it.

My use case is that I want to bulk update certain records in Salesforce. My company makes a lot of API calls to Salesforce already - to the point that we are in danger of exceeding our API limits. The Bulk API does not count against those API limits, so I need to use that to make updates.

I have created a csv file (screenshot below). I am using the Salesforce Field names as the headers. Is that correct? If not, what should that file look like or what does it need to include?

image

I created a Salesforce Application Scope and tested my connection to Salesforce. It’s looking good. Then I added a “Create Bulk API Job” activity.
I set the properties as such: columndelimiter: Comma, LineEnding: LF, Object: “Order”, and ID: “SFID”.

When I run the file I don’t get any errors, but my Salesforce records are not getting updated. What am I missing?

I also tried putting a “Start or Abort Bulk API Job” action after the “Create Bulk API Job” activity, but that also did not update my Salesforce records.

Hi @sfergu_083

I see a salwsforce status property can you set a variable and see ehat value it is returning …that might give you information on what happened

Cheers

Hi Anil,

The Salesforce status property returns “true” - so something appears to be working, but my records are not being updated.

@sfergu_083

Can you try running in debug and check the locals tab…on what is hppening in the activity if any values are returned

Cheers

Hi Anil,

I gave it a try and saw everything I expected to see. Nothing seemed unusual there. Maybe creating the Bulk API job is just the first step. I tried adding an action called “Start of Abort API Job”. My reasoning was that maybe a job needed to be created first and then it needed to be started in order for it to make updates in Salesforce. It’s just a guess.

When I did that, I got an error saying:

Activity Start or Abort Bulk API Job ended with error:
Error Code: [METHOD_NOT_ALLOWED]
Message: HTTP Method ‘Patch’ not allowed. Allowed are HEAD,GET,PUT,PATCH,POST,DELETE

I don’t know where the “Patch” Method is coming from though. In the “Create Bulk API Job” activity I specified that it was an “Updated” operation.

1 Like

Even am stuck with the same issue… am able to Create Bulk API, then could not start it… please help me on this.

Activity Create Bulk API Job ended successfully
Activity Start or Abort Bulk API Job ended with error:
Error Code: [METHOD_NOT_ALLOWED]
Message: HTTP Method ‘Patch’ not allowed. Allowed are HEAD,GET,PUT,PATCH,POST,DELETE

Is this something happening due to Case Sensitive behaviours? please investigate in this direction as well.

Activity Start or Abort Bulk API Job ended with error:
Error Code: [METHOD_NOT_ALLOWED]
Message: HTTP Method ‘Patch’ not allowed. Allowed are HEAD,GET,PUT,PATCH,POST,DELETE

Hi, after the recent release ‘PATCH’ method issue is solved. however i don’t see updates in salesforce records. It shows execution successfull but no records in Succeeded or Failed… and also getting error while fetching unprocessed records.

Activity Create Bulk API Job ended successfully
Activity Start or Abort Bulk API Job ended successfully
Activity Get Bulk API Job Results ended successfully
Activity Get Bulk API Job Results ended successfully

//fetch unprocessed records//
Activity Get Bulk API Job Results ended with error:
** Error Code: [UNKNOWN_EXCEPTION] **
** Message: An unexpected error occurred. Please include this ErrorId if you contact support: 1549829709-465 (-1627332290)**

BlankProcess1Template execution ended in: 00:00:25

Same here, Renugopal. I updated the UiPath.Salesforce.Activities package to v1.9.2 and the Patch error on the Start or Abort Bulk API Job action is no longer occurring. But my Salesforce records are still not getting updated.

Acitivty Create Bulk API Job ended successfully
Activity Start or Abort Bulk API Job ended successfully
Activity Get Bulk API Job ended successfully
Get Bulk API Job SalesforceStatus = Success
Get Bulk API Job State: Failed
Get Bulk API Job NumberRecordsFailed - 0
Get Bulk API Job NumberRecordsProcessed - 0
Activity Get Bulk API Job Results ended successfully
“Results” variable under Get Bulk API Job Results activity = blank

I guess the state of the Get Bulk API Job failed, which may mean something, but what do I do about it?

Did anybody get the SF bulk api working?

@Jacco_21Digitals Not yet. I submitted a case to UiPath and they told me it is a bug on their end and their product team is working on it. No ETA on the fix yet.

Many thanks!