Is it possible to generate contract number automatically only when exact condition is met?

Hello,

I need to create contract number if the form type is “Final survey”. Is it possible to generate contract number automatically only when this condition is met? If the form type is another value, then there is no contract number generated. I have tried to look into conditional formatting and if formula, but can’t find the solution.

Thank you for you help.