# Service Connect - Add line #'s to PR check detail in incoming file? **Category:** [Epicor ERP 10](https://www.epiusers.help/c/e10/5) **Created:** 2016-11-15 22:30 UTC **Views:** 841 **Replies:** 5 **URL:** https://www.epiusers.help/t/service-connect-add-line-s-to-pr-check-detail-in-incoming-file/36300 --- ## Post #1 by @JonF Hi Everyone, I'm new to the group, but glad to see such an active community! I have a payroll file we need to import into E10, it contains detail records (and needed header info all in same rows). We have it working perfectly except that it needs the line #'s added into the file so we can feed it to the paycheck detail records in the workflow. We're using the PayRollCheckEntry.UpdateExt (batch) method, using GetNewPRCheckForGroup before that to get the new check. The file has EmpID's & 1-4 payroll records per employee ID. We just need to assign Line #'s to the records, per EmpID (1, 2,3..). I just haven't been able to figure this out & haven't found any good examples. I think we need to: * Use a sub-workflow just to iterate thru the records (I have this happening) * Then Count & Save the Line number value on each record * think I have to copy the original data package, so we can update it, doing this fine * But I can't find a way to Count the record #'s, or just access the RecNo() or "IterationNum" of the subworkflow & then save this # as the LineNum value in the row. * And can't figure out how to pass the data (rows) OUT of the subworkflow, following the help I see where you can assign it in the conversion after the subworkflow but I can't get it to return more than one record, so it may be the schema or something?? I do see in the log viewer where it does iterate thru once for each record, just don't know how to count & save/return the line #'s in the data & pass resulting recordset out to main workflow. There's unused columns in the csv file, so if I manually put line #'s in the file, I can map it to the check line # & automation works great, adds check & "hours" records perfectly. Now I just need to figure out how to make that happen inside the automation - we can't get the source file to change, need to manipulate in ESC then. Thanks very much for any assistance in conquering this beast! Jon --- ## Post #2 by @rbucek Jon, under the wfl node there is an IterationNum, tho i wouldn't recommend using it for what your'e after (what if the record didn't get created?). Do a get rows after the update and use a functoid to count the rows returned, and store that in the schema you will pass back up. Your collection schema (defined in your sub element) needs to be a table, it can't have a sheet in it (a bug?). In your sub workflow create a msg extension with the same name of the collection in your calling work flow the finish element of the sub should have the schema you want for passing the data (map your stuff to that) below is the xslt transformation in the parent immediately after the sub, you should be able to see your nodes under the collection (in this example, Allocation). HTH --- ## Post #3 by @JonF This is great info, thanks a lot Rob! I did see the IterationNum, but I didn't know how to extract that value (in a functoid) & store in a field - is there one that would let me put in that value? *it doesn't show up in the transformation, it only shows up after the run, in the data log, like you show above. But I wondered if there was a way to reference that 'by name' somehow, in a functoid? I'd need to do it for each iteration/detail row & store that value in say, "field20", in each detail row. I think it would be perfectly fine if a row didn't get saved, it would just not have a line w/that #. They are updated in one batch anyhow, so you wouldn't know until after they are all saved anyhow. Once we work out all the data issues, the format of the data should be pretty much the same in all files. They will not even edit this data generally, will just write the paychecks of what the file fed in. I looked at that count node-set but didn't think it would work, wasn't sure but it didn't seem to return the iteration #. I'll give that a shot, the steps you laid out to get it to return a table & see if i can get that working. I didn't quite get that nuance of naming the msg extension the same name as the calling wf collection! *I'm not doing any updates in the swf, just looping thru rows of the collection (copy of) & trying to write the LineNum in each. The single batch update (UpdateExt) actually occurs in the main wf. But all the work done to the data in the main wf should use the rows, once the swf has added in the linenums. I really appreciate your help! --- ## Post #4 by @rbucek if you see data in the log, it's available for you to map and work with. --- ## Post #5 by @JonF Yes you'd think so, but it's not visible in the conversions, so if I can call it by name somehow that may work but not sure how/where to do. This SubWF doesn't expand like you see in the log, when in the conversion mapper (inside the swf): You just see this: So I can't drag IterationNum to any field or functoid. --- ## Post #6 by @rbucek [quote="JonF, post:5, topic:36300"] you see in the log, when in the conversion mapper (inside the swf): You just see this: [/quote] I'll take a look at that on my end, won't be till monday though, i swear I'm dragging some stuff out of there... --- **Canonical:** https://www.epiusers.help/t/service-connect-add-line-s-to-pr-check-detail-in-incoming-file/36300 **Original content:** https://www.epiusers.help/t/service-connect-add-line-s-to-pr-check-detail-in-incoming-file/36300