Sending Bricks Builder Forms Data From WordPress To Airtable

WordPress snippet for Bricks Builder that sends all form fields data to Airtable using a webhook.

This is a custom function in PHP that hooks into the “bricks/form/custom_action” action in WordPress. The function takes one parameter, a form object, and retrieves the fields of the form using the “get_fields” method. It then sets a variable “webhook_url” to a specific URL, and creates an argument array that includes the fields of the form as the body. The function then makes a remote post request to the specified URL using the WordPress function “wp_remote_post” and the arguments array. Finally, the function sets a result for the form, with an action, type, and message specified.

function my_form_custom_action( $form ) {
  $fields = $form->get_fields();
  // $formId = $fields['formId'];
  // $postId = $fields['postId'];
  // $settings = $form->get_settings();
  // $files = $form->get_uploaded_files();
  // Perform some logic here...
  $webhook_url = 'https://YOUR-WEBHOOK-URL-GOES-HERE';
  $args['body'] = $fields;
  $response = wp_remote_post($webhook_url, $args);

  // Set result in case it fails (if needed)
    'action' => 'my_custom_action',
    'type'    => 'success', //or danger or info
    'message' => esc_html__('Oh my custom action failed', 'bricks'),

add_action( 'bricks/form/custom_action', 'my_form_custom_action', 10, 1 );



Leave a Reply

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

This is an Advertorial

Learn how to build digital products without writing a single line of code

Build anything you can dream of without writing code or hiring a developer

Our non-technical students start companies using tools like Bubble, Softr , Elementor and Airtable. It’s easier, faster and more fun.

No matter what your background is, our lessons are designed to figure out what you don’t know and fill in the gaps

Join our learning community of soulmates, learn at your own pace and stay motivated to reach your objectives.

Begin Your No-Code Journey.

Training Mode : in-class
Location : E-349 Ikota Shopping Complex, VGC, Ajah, Lagos
Fees : N150,000