I can get back an array of objects using ct..payloaad.snapshots.snapshot but I want to have the length of the array. Does someone know whether this is possible and how?
Jettro, looks like snapshots is not an array, but a list? Is it by any chance coming from a json payload? for real "arrays" .length should indeed work (as well as size())
The payload is coming from this response, it looks line an array to me in Json. Not sure what groovy does with it though. From the jsonslurper documentation I read they convert arrays to lists. In that case what you're saying @url sounds like the reason. It is a List not and array.
so if it's coming from json, then actually its watcher that converts the json arrays to lists :)... I just wasn't sure where you're gettings snapshots from (it could have been from a script transform)
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.