I have a formit form that uses the FormItSaveForm hook.
I have created a modx snippet that includes a PHP file that saves posted data that I need in order to render pins on a web page that displays a Google map.
Additionally, I would like to save the formit form id or hash from the record that got created in the modx_formit_forms table to my custom table.
How would I pass along the id or hash to my PHP file that gets included from a modx snippet I created.
The formit snippet call looks like this:
Survey: [[!display_custom_context? &context_name=rural_location_display_name
nospam:blank, search:required, address_type:required
The modx snippet call looks like this:
<?php ini_set('display_errors',1); error_reporting(E_ALL); include $_SERVER['DOCUMENT_ROOT'] . 'path/to/include/add_location.php';
I’ve included the config.inc.php, config.core.php, and the modx.class.php in my external PHP file and can run functions like writing to the error log
But still cannot figure out to get the formit form id or hash from the record saved from submitting the form, short of just running a database query that gets the latest id saved to the modx_formit_forms table.