Forum

Thread tagged as: Question, Api, Forms

Forms App on submit action another app

Hi,

Along with using the Forms App I would like to able to insert the submitted data in to secondary database as well. It seems I maybe able to do this via a custom app? Can anyone provide some guidance on how to action the app on the form submission?

Many thanks Michael

Michael Grinstead

Michael Grinstead 0 points

  • 4 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

You can add multiple apps as a string:

"Multiple apps can handle the form submission. This can be useful if you want to have more than one app perform an action based on the content of the form (e.g. create a member and add them to a mailing list)."

https://docs.grabaperch.com/templates/form/form/

Many thanks Rachel,

I did do this and also added the custom app to the config > apps file, but I think this actions the app on every page load. Is this correct? I don't require the app to be displayed in the admin console, just a file to insert data in to the database.

Michael

Rachel Andrew

Rachel Andrew 394 points
Perch Support

If you have runtime functions then you need to add it to the apps file otherwise you'll get errors when it can't be found.

So do I need to include the runtime file if I don't have any runtime functions? I have a file that will execute a SQL insert statement, will added the custom app name to the form be suffice?

Thanks Michael

Rachel Andrew

Rachel Andrew 394 points
Perch Support

If you want people to interact with it from the front-end of the site you need to add it to apps.php.

If it is admin only - only appears in the Control Panel - then you don't need to do that.

Many thanks Rachel.

Michael