Hi Liorlankri
U can do it in a simpler way.
1)Keep a field in ur datasource called FormName.
2)U can update this field each time u submit or save the form.
3)If u use a Submit dataconnection(eg to SharePoint),then there is an option to specify or select the Form Name from a field in the Datasource.
Use this option to specify the name from the FormName field.
Regards,
Abhishek