For query types other than post, term and user in Bricks i.e, ACF Repeater/ACF Relationship/Meta Box Relationship there are no built-in controls for modifying the parameters like being able to limit the result count or show the results in random order.
But Bricks does provide a filter to do this programmatically called bricks/query/run.
Here’s an usage example.
Let’s say you have a Meta Box Relationship between two Custom Post Types called “Service to Review”.

Now, in the single service
template you want to show the review
CPT posts that are related via this relationship.

To limit the posts count to say 4 and to show them in random order, add the following in child theme‘s functions.php
or a code snippets plugin:
add_filter( 'bricks/query/run', function( $results, $query_obj ) {
if ( $query_obj->element_id !== 'nhuhtp' ) return $results;
// limit the array count to 4
$results = array_slice( $results, 0, 4 );
// set random order
shuffle( $results );
return $results;
}, 30, 2);
Replace nhuhtp
with the Bricks ID of your query loop element.
3 comments
Smith Benites
Hello, excellent tutorial, it works perfect.
I have a question, if I would like to have a conditional so that when there is no related repeater the whole section is hidden. Is that possible?
Eric Embacher
Instead of a random order, how would I order the records by a field in an ACF repeater named "orderby"?
Eric Embacher
Nevermind...I found https://brickslabs.com/sorting-acf-repeater-query-by-sub-field-in-bricks/