Bricks Forms Custom Actions

I’ve read the documentation about the custom php hook , but I’m confused about returning data back to the form or to the redirected page.

I added my function to the return in the example, which generates json input to a Bricks query loop. I need to understand how I can either display the loop on the same page as the form, or pass it to the redirected page and run the loop there.

I’ve failed to find any other examples other than that in the documentation.

Any help will e appreciated.