I don’t fully trust data I’m receiving from an outside source via their API. So I’m tossing ‘Trim’ at all the values before commiting them to the database.
Question: Does anyone worry about trimming this sort of data? And if so, is there a shortcut for what I’m doing with 2 steps? (below)
My personal rule-of-thumb is that if the value is coming from a user entered field - then I always perform a Trim (and/or other necessary validation logic), before using the value or saving it to a database or other storage method.
So that in theory, any stored database values should already be clean. But if you’re not in control of what was saved, it certainly doesn’t hurt to err on the side of caution. Unless of course there are so many values you risk a performance hit.
Anyway, to answer your second question. If you know that Variant Value(“Enrolment Specialty”) will always be a string, you could do a one liner like: