Impossible to invoke a method on array. How to merge multiple objects and keep as objects {% set newsletterImages = newsletter.imagesCongratulations|merge(newsletter.imagesCis)|merge(newsletter.imagesSection3) %}
{% set transformedImages = newsletterImages %}

{% for image in newsletterImages %}
  {{ image.title }}&lt;br /&gt;

{% endfor %}


newsletterImages is merging images from 3 different global fields.
I want to then randomise and only output 6 of these images.

However, when I try 

{% set transformedImages = newsletterImages.orderBy('RAND()').limit(6) %}


I get the error: Impossible to invoke a method ("orderBy") on an array. and Impossible to invoke a method ("limit") on an array.

Can anyone help point me in the right direction to achieve this?
You can achieve this with Craft's shuffle() method and Twig's slice filter (like you mentioned in your answer).

{% set newsletterImages = newsletter.imagesCongratulations.all() %}
{% set newsletterImages = newsletterImages | merge(newsletter.imagesCis.all()) %}
{% set newsletterImages = newsletterImages | merge(newsletter.imagesSection3.all()) %}

{% set shuffledImages = shuffle(newsletterImages) %}  // Shuffle our "master" array

{% for image in shuffledImages[:6] %}  // Get the first 6 images
  {{ image.title }}&lt;br&gt;
{% endfor %}