Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make a bulk call with multiple queries? #57

Open
anothermh opened this issue Feb 12, 2016 · 0 comments
Open

How to make a bulk call with multiple queries? #57

anothermh opened this issue Feb 12, 2016 · 0 comments

Comments

@anothermh
Copy link

The example for queries only shows a single query being submitted. How do you run multiple queries in one bulk call? When I follow the example in the README it runs immediately and synchronously returns the values for only the one call.

bulk = SalesforceBulkApi::Api.new(restforce_client)
response = bulk.query('Contact', "SELECT Id, AccountId FROM Contact WHERE Email = '[email protected]'")

response['batches'][0]['response'] returns:

[
    [0] {
         "xsi:type" => "sObject",
             "type" => [
            [0] "Contact"
        ],
               "Id" => [
            [0] "00336000004AVvHAAW",
            [1] "00336000004AVvHAAW"
        ],
        "AccountId" => [
            [0] "001360000027qGJAAY"
        ]
    }
]

What I would like to do is something like the example below, but it's unclear how:

array = []
array << "SELECT Id, AccountId FROM Contact WHERE Email = '[email protected]'"
array << "SELECT Id, AccountId FROM Contact WHERE Email = '[email protected]'"
bulk.query('Contact', array)

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant