Hello everybody.
Full disclosure here: I am new to Marketing Cloud and this would be my first Journey that I've set-up, so I am going through a learning curve.
We are planning to send an interactive form to prospective Leads that have incomplete data (missing name, partial names, placeholder names, etc) via a Journey.
I am populating the source DE used in the journey via a SQL activity in Automation Studio.
I have created a target DE to receive the form submission data that also contain a few extra fields (i.e. *LeadId, FirstName, LastName, Email, StreetAddress, City, State, PostalCode, *WasUpdated, *DateUpdated). * = hidden fields.
I would like to trigger some validation to occur after each row is added to the DE. the validation would check the length of the supplied values LENGTH(FirstName) > 1 & LENGTH(LastName) > 1.
However, after adding a decision split it doesn't look like you can compare LENGTH of a string, only Contains, Equal, Null, Not Null, etc.
What is the best method to perform some basic data quality prior to an update of the respective Lead record in Sales/Service Cloud?
IF LEN(FirstName) > 1 UPDATE
ELSE do not update
IF LEN(LastName) > 1 UPDATE
ELSE do not update
Seems to be update all fields or no fields in the Lead activity within the Journey.
If the data that was provided is equal or worse than when we started, we probably don't want to update (and overwrite) what we already had.
What is the best method to do these checks? AMPscript? SQL Activty with an update on the DE to set boolean flags and decision based on these flags?
Forum Ambassador Mateusz Dąbrowski (mateuszdabrowski.pl)
As you want to use Interactive Email, you won't be able to leverage the best method - real-time validation at the submission and asking the user to fix the issues.
That leaves you with two (similar) options:
1. Automation Studio with Query Activity to do the validation checks and move only validated records from your target DE to a staging DE that will be then used by Script Activity to push valid data to Salesforce using AMPScript in SSJS trick.
2. Go straight to Script Activity in your Automation and validate using only SSJS.
The second option is less performant but can be more flexible in terms of validation rules (full regex, possibility to leverage 3rd party data for comparison using APIs, etc.). For small volumes, it might be better.