How to delete empty rows from the table


How can the rows with empty Fields be removed from the results?


The possible methods are as follows:

  • Create a FlexiLayout and export only the required information from the table using the Repeating Groups: FlexiLayout: Capturing a table using Repeating Group
  • Use a Custom Scripting Stage (Processing Script) in the Workflow or Event Handler Script to remove empty rows. This stage can be created after the Recognition stage if you have a completely empty row of the table, but it may be used after the Verification stage as well. You may refer to a sample C# script below which removes a row from the table if it has an "EmptyFieldName" field with an empty string value. Please mind, that it's not ready to use solution, so you'll need to customize it according to your needs for your project.
    string table = "Document Section 1\\Table";
    int rowCount = Document.Field(table).Items.Count;

    for (int i = 0; i < rowCount; i++){
        if (Document.Field(table).Rows[i].Field("EmptyFieldName").Text == ""){
    rowCount -= 1;
  • Create a Custom Export Script in Document Definition -> Export Settings -> Export Destinations, where it is possible to describe how documents should be exported, and the empty rows can be deleted during the export:

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request


1 comment

  • Avatar

    Samir Waikar

    Hi Ivan,

    I created a new stage after verification stage and in script , selected "Document processing" and written c# code. Not getting any error but script is not getting executed.  Row with empty field name still getting exported. In the following eg. "Tfield" is an empty field.


    Can you please check what is missing or can anybody?






Please sign in to leave a comment.