How to access the instance of the field inside of the Repeating Group with a Script Rule?

Question

How to access the instance of the field inside of the Repeating Group with a Script Rule in ABBYY FlexiCapture 12?

Answer

As the field inside the Repeating Group is the collection of the fields, you need to specify its instance in a form of Field("<Field Name>").Items[i] (where i is a number of an instance) to access it.

As an example, the following Script Rule assigns the text of the second instance of the "Designation" field (which is a field inside the Repeating Group) to the "Field" field.

mceclip0.png

//C#
Context.Field("Field").Text = Context.Field("Designation").Items[1].Text;

Was this article helpful?

1 out of 1 found this helpful

Have more questions? Submit a request

Comments

3 comments

  • Avatar

    DS

    what about a nested repeating group? how to access it or get the instance number?

    e.g. I want to get Instant 2 , and nested instant 3 in instant 2 --> repeating group [2,3]

    I am trying to write a script to loop it but failed.

    0
  • Avatar

    Anton Vakhtel

    @DS, Hello!

    Depending on what you need, and how your Repeating Groups look like, you could be able to access it the same way as described in an article.

    But, it seems to be not possible to access it using the obvious Context.Field("Field").Items[i].Items[j].Text.

    If you would like for the Support Team to take a closer look on your question, please submit a request and share your project with us, we will be happy to help.

    Best regards,

    Anton

    0
  • Avatar

    DS

    Thanks, I submitted a request #466232

    Yes I tried .Items[i].Items[j] before but no luck.

    And items.count will get the number for total item counts, instead of the items count for each individual nested repeating group

    0

Please sign in to leave a comment.