Adding Preceding Zeros to a Column

Hi @namankumar169,

I have posted this answer already in this topic where you asked the same question. I am going to close the other one.

However, another easy way to solve this task is using the Column Expressions node with this script:

if (length(column("column1"))<2) {
    "0" + column("column1")
} else {
    column("column1")
}

column1 must be replaced by your column name. Here is also an example workflow:add_leading_0.knwf (6.2 KB)

Cheers,
Simon

5 Likes