There is a solution of creating autoincrement field in main data source using "../preceding-sibling::my:item" expression in "How To". But I need such kind of field in secondary data source. It has a dummy field intended to populate by identity values in Infopath. Yes, it is possible to get identity values from data server, but it is not suitable in my situation. I need to this field be populated in Infopath.