Community

Use script to add instance of recurring field within Document skill

Hello

I am reading line items from an invoice into a recurring field. For some items, I need to create additional lines. An example of this might be an invoice that contains the item "cutlery set". I need to replace the single line "cutlery set" with three new lines "knife", "fork" and "spoon".

A key part of doing this is the ability to add instances to a recurring field (let's call it 'Products').

I have been able to do this using the Custom block within a Process skill. Example code below.

var currentdoc = Context.Transaction.Documents[0];
var OutputList = currentdoc.GetField("Products");
OutputList.AddInstance();

I would like to be able to do the same thing using a Script activity within the Document Skill itself, but the AddInstance property does not seem to exist in this context.

Does anyone know if it is possible to add instances to a recurring field through a script within a Document Skill?

Was this article helpful?

0 out of 0 found this helpful

Comments

2 comments

  • Avatar
    Tatiana Dyu

    Hi Joe, currently it is possible to add an instance of a field via the Custom activity only. The main usage scenario for that method is when i.e. verification is done outside Vantage, and a 3rd party system may need to return additional instances of a field along with the values back to Vantage for further processing. If you have other use cases and scenarios in which you need to add field instances from other types of scripts, please feel free to submit a feature request ticket https://support.abbyy.com/hc/en-us/requests/new

    0
  • Avatar
    Joe Corcoran

    Thanks Tatiana. That clears up the question for me. I can do what I need using the Custom activity, so I'll stick with that.

    0

Please sign in to leave a comment.