How can I substring a string like /com/app1/main to get the value of main in a HELM template ?
You can use the regexFind function in helm
regexFind "[^/]+quot; "/com/app1/main"
Will get the text following the last /
Helm uses the sprig library to provide lots of data manipulation functions, have a look at their docs. You can use the {{ base }} function to do what you want.