Dynamically inserting fields in a form and capturing them in a submission? #1364
Replies: 1 comment 3 replies
-
|
Submissions can only hold fields that are Formie field, not Craft fields, or other data. In order to record them against the submission, they'd need to be stored on it somehow. Compared to Freeform, Formie does work a little differently where this isn't possible like it is with Freeform, because integrations fire through the queue. With Freeform that data is there in POST data, but that's no longer the case with Formie and the queue. It might be a neat idea to be able to store arbitrary extra data on a submission, but it still wouldn't be overly useful, because you would have to define what to do with that data. You can certainly also modify the payload that the integration sends via events if you have some PHP and module know-how. That way you can keep it completely out of the front-end altogether. I suppose I would suggest to create a hidden input on every form to store this data. You can use |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This might be an odd one, but I'm curious if there's a way for a submission to include fields that are not part of the Formie form.
I have a client who regularly micromanages the tracking parameters in URLs for their paid campaigns. Because they have many forms, I want to avoid having to edit every form whenever they want to add/remove tracking parameters that should be included in the form submission.
Currently, they have a Global field where they list the query parameters they want to track. Our base template grabs those and stores them on the
window. Then, whenever a form loads (I'm using Freeform currently), I grab any query parameters from the URL that match these "tracked" params, I create a new hiddeninputwith that param's value, and I add it to theformelement. Of course Freeform is unaware of these — so they don't show up in submissions or anything — but because I'm forwarding the submission to a third party (per my question in #1361), I just need them included in the payload.This is where I'm blocked with Formie. Any ideas how I could work around this?
Beta Was this translation helpful? Give feedback.
All reactions