Need to extract Table Line items from invoice document using Modern Document Understanding

Hi,

I am trying to extract Table Line items from PDF invoice using DU modern.
While doing so getting the error below in image.

Any help appreciated. Thanks in advance!

hi, @sahiljaiswal573

Use this expression to get the first line’s LineNumber

Extracted_Data.Data(“Items”).Values(0)(“LineNumber”).ToString

If you loop the rows, replace 0 with the loop index to read each line item

1 Like

Hi @sahiljaiswal573

This error happens because table line items from DU are a collection and cannot be accessed directly with an index or property. You must loop through the table rows first. Use a For Each on Extracted_Data.Tables(“YourTableName”).Rows and then access values using row(“ColumnName”). Accessing table items directly in a Message Box or Assign causes this error.

I had tried your code but it’s not working.

Hello @Maheep_Tiwari,

Without loop how can i resolve this issue.

You cannot truly resolve this without iteration. DU table line items are collections, so some form of iteration is mandatory. Even if you avoid a For Each activity, LINQ still loops internally. There is no supported way to access individual table values directly without iterating.

@sahiljaiswal573

Try this:

replace Items with your table name in the taxonomy.

replace (“LineNumber”) with the column name inside that row

@sahiljaiswal573

Welcome to the community

please try as below

cheers

1 Like

Hi @sahiljaiswal573,

Try this is

Extracted_Data.Data.Item(“Items”).Values(0)(“LineNumber”).ToString

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.