trying the below code in a custom sdk in Workato
poll: lambda do |connection, input, last_updated_at|
per_page = 1
last_updated_at = (last_updated_at || input['since']).to_time.utc.iso8601
candidates = get("https://api.stripe.com/v1/customers")
last_updated_at = candidates.last["created"] unless candidates.blank?
Getting an error undefined method `last' for #Hash:0x00007f303593d6d8 at line:
There is no
Hash#last
method. Hashes do keep their insertion order, but you should conceptually treat them as unordered. The concept of the "last" element of aHash
simply does not make sense.