This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
We've recently made an accessibility improvement to the community and therefore posts without any content are no longer allowed. Please use the spoiler feature or add a short message in the message body in order to submit your weekly challenge.
The error is in the syntax of the PadLeft function. You should have accounted for the length that the String needs to be once you insert the prefix character. The below modified code should work for you. Hope this helps!
IF Length([Safety Code]) = 6 THEN PadLeft(PadLeft([Safety Code], 7, "C"), 8, "S") ELSE [Safety Code] ENDIF
The complete formula using PadLeft (accounting for the other conditions) would look like this: If Length([Safety Code]) = 6 then PadLeft(PadLeft([Safety Code], 7, "C"), 8, "S") ELSEIF Length([Safety Code]) > 8 then Left([Safety Code], 😎 ELSE [Safety Code] ENDIF