I had a user that filled a form with "null" as the company name. Since i am not using embedded marketo forms but backend submission, the value of the company name was null. even if i sanitize the field, the value is still null because it's a valid string. The result of it was that the company name stayed empty and the lead did not sync into SF because of the mandatory field requirement.
I have a way to validate and return an error to the user on form field globally in code but i wanted to use the smarts of the nation and see if there is a better way to resolve this. Please feel free to bash me for bad behavior if exists.
Not sure I see the problem?
All form field values are strings in transit: unlike JSON properties, they're not typed unless the back end decides that some have special meaning, like Marketo also does with NULL.
If you want to avoid the system-special values you'd need to create your own special value, like [N/A].
I understand that but what happens when the user decides to put 'null' in one of the fields?
The two solutions here, in my opinion, can be:
I would actually want to see it as a functionality of the embedded forms.