I've got a custom process which allows users to match manually uploaded data to SF ContactID values. It relies on the EmailAddress field being called EmailAddress and having the correct field type to work. We've had some instances where users have created an EmailAddress field as Text Type, or they called it email_Address or some other name that won't parse.
I currently have some error management in place for names that are too long or have a space in their name - both of which cause the rest of the process to fail.
Is there a way - preferably using ampscript rather than SSJS, I can retrieve all fields from the specified data extension, and throw an error if there isn't an EmailAddress field with the correct name and type?
For example, this is my error management for the other issues:
%%[
set @de = RequestParameter("de")
set @len = Length(@de)
set @sp = IndexOf(@de," ")
IF @len < 27 AND @sp == 0 THEN
]%%
Run SSJS
%%[ELSE]%%
Error Message
%%[ENDIF]%%
I'd like to check for an EmailAddress field at this stage too.