You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there an API on zoho_hub to solve this easily?
If it don't exist, i think create one.
What interface do you think should be?
I think a following interface.
module ZohoHub
class BaseRecord
class << self
def bulk_upsert(arr)
By the way, I wrote the following code and performed a batch update.
class Account < ZohoHub::BaseRecord
attributes(:id, :name)
attribute_translation(
id: :id, # Make lowercase when converting to json.
)
end
accounts = Account.all
# A maximum of 100 records can be inserted/updated per API call.
# https://www.zoho.com/crm/developer/docs/api/upsert-records.html
batch_size = 100
accounts.each_slice(batch_size) { |arr|
ZohoHub.connection.put(
'Accounts',
{data: arr.map(&:to_params), trigger: 'approval'}.to_json)
}
The text was updated successfully, but these errors were encountered:
The following code is very slow (because the PUT request is executed 200 times)
Is there an API on zoho_hub to solve this easily?
If it don't exist, i think create one.
What interface do you think should be?
I think a following interface.
By the way, I wrote the following code and performed a batch update.
The text was updated successfully, but these errors were encountered: