<p>Generally speaking, as I may not understand everything you are trying to do, it may be easiest to just have a custom module watch the <code>\barrelstrength\sproutforms\elements\Entry::EVENT_BEFORE_SAVE</code> Event and store the data as a JSON blob wherever you'd like.</p>

<p>If you don't wish to store the data in the normal way Sprout Forms lets you disable saving data to the database, or enable it and set the default to off so you only need to turn it on for use cases where you may want it to store the data in the plugin itself.</p>

<p>As far as retrieving that data, that would be up to you as you're storing it in a way that Sprout Forms wouldn't understand unless you retrieve and re-populate a Form Entry Model at some point in your workflow.</p>

<hr>

<p>For a more integrated solution, you may want to explore Sprout Forms <a href="https://sprout.barrelstrengthdesign.com/docs/forms/custom-integrations.html" rel="nofollow noreferrer">Custom Integrations API</a>.</p>

<p>Integrations will run after a Form Entry is submitted and validated so you can use the Sprout Forms form builder to build and validate forms (and use features like conditional fields) and then, once the form is submitted you can hand things off to your Custom Integration and send the data wherever you'd like (to a third-party API or just somewhere else in the same database as you describe).</p>

<p>Some of the default integrations give examples on how you can build an Integration to handle custom mappings where you give the admin user an option to map the form fields they create to wherever you want to send the data to, however, Integrations don't require a mapping. If you just want to send the whole payload to a custom endpoint, you can do so and configure the endpoint of your other application to know what to expect.</p>

CC BY-SA 4.0
2019-11-23T02:36:34.030Z
2019-11-23T02:36:34.030Z
Ben Parizek
<p>We have a placement tool that is currently based on a proprietary PHP MVC framework.  We have a need to quickly build custom forms that contain various checkbox, radio and text fields.  </p>

<p>We want to store/retrieve the entire form data in our database, outside of Craft, into a custom jsonb column, along with special key fields, etc.  We currently call our custom Craft plugins from our legacy framework via specified url/action and parameters (which displays the content in an iFrame).  We'd probably use the same method for forms as well, until we can migrate or go to a Vue.js/Headless Craft setup.</p>

<p>Other forms tools, I have reviewed, store the forms within Craft as 'submitted' forms.  We need to keep them in our own database.</p>

<p>Thanks!</p>

CC BY-SA 4.0
2019-11-23T06:16:17.710Z
Thank you Sir, for you speedy reply!, This sounds great.  Basically, I would like to use your plugin to build/store & manage forms and then use custom integrations to interact with my backend and database.  - D
Unlimited
<plugin-sproutforms>
Sprout Forms - Use Case - Retrieve/Store form data into a custom db table
# Sprout Forms - Use Case - Retrieve/Store form data into a custom db table

(Asked by: username_0 on 2019-11-22)

We have a placement tool that is currently based on a proprietary PHP MVC framework. We have a need to quickly build custom forms that contain various checkbox, radio and text fields.

We want to store/retrieve the entire form data in our database, outside of Craft, into a custom jsonb column, along with special key fields, etc. We currently call our custom Craft plugins from our legacy framework via specified url/action and parameters (which displays the content in an iFrame). We'd probably use the same method for forms as well, until we can migrate or go to a Vue.js/Headless Craft setup.

Other forms tools, I have reviewed, store the forms within Craft as 'submitted' forms. We need to keep them in our own database.

Thanks!

**Tags:** plugin-sproutforms

> **Comments:**
> **username_0**: Thank you Sir, for you speedy reply!, This sounds great.  Basically, I would like to use your plugin to build/store & manage forms and then use custom integrations to interact with my backend and database.  - D  

---

## 1 answers

### Answer by username_1 on 2019-11-23. Score: 2

Generally speaking, as I may not understand everything you are trying to do, it may be easiest to just have a custom module watch the `\barrelstrength\sproutforms\elements\Entry::EVENT_BEFORE_SAVE` Event and store the data as a JSON blob wherever you'd like.

If you don't wish to store the data in the normal way Sprout Forms lets you disable saving data to the database, or enable it and set the default to off so you only need to turn it on for use cases where you may want it to store the data in the plugin itself.

As far as retrieving that data, that would be up to you as you're storing it in a way that Sprout Forms wouldn't understand unless you retrieve and re-populate a Form Entry Model at some point in your workflow.

---

For a more integrated solution, you may want to explore Sprout Forms [Custom Integrations API](https://sprout.barrelstrengthdesign.com/docs/forms/custom-integrations.html).

Integrations will run after a Form Entry is submitted and validated so you can use the Sprout Forms form builder to build and validate forms (and use features like conditional fields) and then, once the form is submitted you can hand things off to your Custom Integration and send the data wherever you'd like (to a third-party API or just somewhere else in the same database as you describe).

Some of the default integrations give examples on how you can build an Integration to handle custom mappings where you give the admin user an option to map the form fields they create to wherever you want to send the data to, however, Integrations don't require a mapping. If you just want to send the whole payload to a custom endpoint, you can do so and configure the endpoint of your other application to know what to expect.


---

