Comparing and validating form data | Community
Skip to main content
Travis_Schwartz
New Participant
May 9, 2023
Solved

Comparing and validating form data

  • May 9, 2023
  • 2 replies
  • 1721 views

Hello,

 

I'm being asked if there is a way to have a form and have Marketo look at the fields (still trying to identify what fields, but for security purposes, it would need to be more than email address). Is there a way for Marketo to compare the form entry to information on a record? do email, address, name, etc all match an existing record? if so send a confirmation email. We don't currently have passwords saved in Marketo... but it's sort of like a forgot username situation. We just need more than an email address to give the relevant information.

 

I'm not really seeing a way of doing it in Marketo alone. Is this something a webhook like flowboost could help with?

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Lots of ways to do this in JS but this FlowBoost payload will work fine:

let setOne = [{{lead.A Field}}, {{lead.Another Field}}, {{lead.Yet Another Field}}]; let setTwo = [{{lead.A Proxy Field}}, {{lead.Another Proxy Field}}, {{lead.Yet Another Proxy Field}}]; isMatch = Object.keys(setOne).every((key) => setOne[key] === setTwo[key] );

 

That’ll set isMatch to true if every value is identical in both lists.

 

For a looser comparison (so strings are case/accent-insensitive) you can use:

isLooseMatch = Object.keys(setOne).every((key) => typeof setOne[key] == "string" ? setOne[key].localeCompare(setTwo[key], undefined, { sensitivity : "base" }) == 0 : setOne[key] === setTwo[key] );

 

2 replies

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
May 10, 2023

Lots of ways to do this in JS but this FlowBoost payload will work fine:

let setOne = [{{lead.A Field}}, {{lead.Another Field}}, {{lead.Yet Another Field}}]; let setTwo = [{{lead.A Proxy Field}}, {{lead.Another Proxy Field}}, {{lead.Yet Another Proxy Field}}]; isMatch = Object.keys(setOne).every((key) => setOne[key] === setTwo[key] );

 

That’ll set isMatch to true if every value is identical in both lists.

 

For a looser comparison (so strings are case/accent-insensitive) you can use:

isLooseMatch = Object.keys(setOne).every((key) => typeof setOne[key] == "string" ? setOne[key].localeCompare(setTwo[key], undefined, { sensitivity : "base" }) == 0 : setOne[key] === setTwo[key] );

 

SanfordWhiteman
New Participant
May 9, 2023

Sure, FlowBoost can easily do this. One of its raisons d'être, even!

 

I'll post a sample snippet later (as I'm on my phone and can't use the syntax highlighter) but it's as simple as JS ===.