Hi,
Follow these steps to get ID from SharePoint list.
1.First generate a unique file name for every form that you are submitting to SharePoint.
2.Then get the unique ID generated by SharePoint for each row in SharePoint list. You can get this two ways
a.Use GetListItems data connection in SharePoint web service
http://<serverName>/<SiteName>/_vti_bin/lists.asmx
You have to use file name as query field.
b.Use SharePoint list data connection. But it returns all rows from SharePoint and then you have to filter the results based on file name.
It is better to use GetListItems to improve form performance because it returns the rows based on query field.