I need to create a unique ID for each time a lead has filled out a form on that specific inquiry.
since the customer does not use SF I need to find a way to create without Sales force.
I was trying to combine the Date or time with the Marketo Unique code token
but when I combine with date there is a - and I don`t want a - in between the codes. when I use time there is a : in-between the numbers....
Is there a way to generate the date without the - or spaces or the time without the :
Solved! Go to Solution.
This is very simple. No reason to generate anything on the server, just generate a timestamp in the browser when the form posts.
MktoForms2.whenReady(function(form){
form.onSubmit(function(form){
form.addHiddenFields({ lastFormPostUniqueId : new Date().getTime() });
});
});
(and of course create lastFormPostUniqueId as a custom field in Marketo)
getTime() is epoch time in milliseconds. No non-malicious lead can post twice in the same millisecond (and since you can append the lead's Marketo Unique Code the final value of lastFormPostUniqueId will be unique to that user).
This is very simple. No reason to generate anything on the server, just generate a timestamp in the browser when the form posts.
MktoForms2.whenReady(function(form){
form.onSubmit(function(form){
form.addHiddenFields({ lastFormPostUniqueId : new Date().getTime() });
});
});
(and of course create lastFormPostUniqueId as a custom field in Marketo)
getTime() is epoch time in milliseconds. No non-malicious lead can post twice in the same millisecond (and since you can append the lead's Marketo Unique Code the final value of lastFormPostUniqueId will be unique to that user).
Thank You Sanford!,
You`have it solved my problem
Hi Sanford,
We have a seemingly similar situation where we're building a Website Login/Registration process using Marketo forms.
We need to essentially dual-post and pass back to Drupal the Marketo Unique ID and the Time of Registration (which you've provided here) so that other internal systems can work on matching and other requirements to identify the user.
We're struggling to understand how to retrieve the Marketo Unique ID to put in that callback to Drupal.
It'll be part of the values object passed to a success listener:
MktoForms2.whenReady(function(mktoForm){
form.onSuccess(function(submittedValues,thankYouURL){
// submittedValues.lastFormPostUniqueId is usable here
return false;
});
});