Hello,
I need to check a flag and if a name field does not contain either : Type, Code, Indicator then write out the records/error message. I am trying to use the following code in formula tool, but this doesn't seem to work for me.
If ([Flag] = 'Y' and (!Contains([Name], 'Type',1) || !Contains([Name], 'Indicator',1) || !Contains({Name], 'Code',1) || !Contains([Name], 'Party',1))) then 'Error - Attribute: '+ [Name]+ else '' endif
Is there a better approach to handling this and can I use FindString to do a similar check? If so, can someone help with some pointers?
Thanks in advance!
Solved! Go to Solution.
IF [Flag] == 'Y' AND ( !Contains([Name], 'Type') AND !Contains([Name], 'Indicator') AND !Contains([Name], 'Code') ) THEN 'Error - Attribute: ' + [Name] ELSE '' ENDIF
I think that this is what you are looking for.
Cheers,
Mark
Hi Mark,
Thank you! I was getting a "Malformed If statement" message due to some extra parenthesis in the code you provided and I fixed it and it worked.