Forum Discussion
83dons
Helper III
1 year agoDealing with nulls when checking email format in a new column
Hi I have a column of emails (called 'Main Email Address'). I have an add column step that works well to check the email addresses for any that do not look like email addresses and if so it just ...
muhammad_786_1
Solution Supplier
1 year agoHi 83dons ,
You just need to add a simple null check to your existing formula to avoid errors. I hope this gives you the desired output.
Table.AddColumn(
#"Replaced Value1",
"Custom",
each
if [Main Email Address] <> null
and Text.Contains([Main Email Address], "@")
and Text.Contains(Text.Range([Main Email Address], Text.PositionOf([Main Email Address], "@")), ".")
then [Main Email Address]
else null
)
Best Regards,
Muhammad Yousaf
If this post helps, then please consider "Accept it as the solution" to help the other members find it more quickly.