1

I'm making a google map feature where you type in a search and it drops a pin on the map (standard stuff).

I want to log all the searches for reporting. So, I'm using a Freeform form to collect the location search and display a map on the result page (using the token approach to get the submission info). The result page uses Smart Map to turn the search into a lat/lng and then render the map. I've got that all working great.

What I'd also like to do, for reporting purposes, is to update the Freeform submission with the lat and lng that gets calculated on the result page.

enter image description here

I haven't found a way to update a submission via twig in the docs. Is this possible? Or are there alternative approaches I should consider?

1 Answer 1

1

Update: Solspace informed me this could be accomplished with a custom module and using a Freeform event, specifically this one: https://docs.solspace.com/craft/freeform/v3/developer/submission-events.html#before-a-submission-is-submitted".

So, in my example, I will need to move my lat/lng logic into the custom module so it happens before the submission is submitted. Then, on the result page, grab the lat/lng from the submission data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.