random submission ninja forms 3

I am very new to wordpress and even newer to ninja forms.

I have form data submitted via ninja forms and I am trying to retrieve a random submission based on user supplied criteria in the from of a couple of select boxes. I’m not really sure how to proceed but this is what I’ve done so far. I created a very basic plugin (following a guide online) and in that plugin I have the following:

$sub = Ninja_Forms()->form()->get_sub( 120 );
$output_name = $sub->get_field_value( 'first_name' ) .  " " . $sub->get_field_value( 'last_name' );

This does, in fact, retrieve a first and last name but only for the submission with a post id of 120.

What I need is to select the first and last name randomly based on all the submissions from the input form. So, if there were 75 submissions, the query would need to get one of the 75 randomly.

I have searched around quite a bit but I either don’t know what I’m looking at when I find something or I can’t find anything.

Any help is appreciated.

Read more here: random submission ninja forms 3

Leave a Reply

Your email address will not be published. Required fields are marked *