Adding Rows using Add Data Row in a For Each Loop

Hello,

I am currently trying to loop through PDFs in a folder and pull out the same pieces of information in each one. To do this I have created a list of the PDFs and am iterating through them in a For Each loop. In the body of the For Each loop, after I have extracted the pieces of information and assigned them to their respective variables, I try to add that to an existing data table using Add Data Row. However, it only adds the Data Row for the first iteration of the loop – it does not continue to add rows even though the variable is being replaced with new information. Please help!


image

I have looked at the example tagged in here and am not sure what is different except that it is in a dowhile and mine is in a for each How To Add Rows in Data Table using loops or itertation
Thanks,

Megan

the IF Statement seems to cancel the for each functionality. I resolved this issue but I hope it helps anyone else who has a similar one!