Search code examples
c#kofax

get KofaxValues besides IndexFields and BatchFields


I want to access the KofaxValues. Currently I know how to work with IndexFields and BatchFields but I don't know how to access these KofaxValues within my setup script.

The ReleaseSetup object contains IndexFields and BatchFields. When launching the Text Exporter in the Kofax Capture Administration module you can map the Kofax Values to your own values.

(the language is german)

enter image description here

It is possible to loop through the fields

            foreach (IndexField field in releaseSetupData.IndexFields)
            {
                // do something with the field
            }

            foreach (BatchField field in releaseSetupData.BatchFields)
            {
                // do something with the field
            }

but where can I find the Kofax Values? I use the Kofax Capture Export Type Library API Reference Guide


Edit:

When it comes to the release I know I could do something like

        foreach (Value val in releaseData.Values)
        {
            bool isKofaxValue = val.SourceType == KfxLinkSourceType.KFX_REL_VARIABLE;

            if (val.TableName.IsEmpty())
            {
                string sourceName = val.SourceName;
                string sourceValue = val.Value;

                // ...
            }
        }

but I don't know how to access them from the setup object.

A pseudo code example would be

        foreach (KofaxValue val in releaseSetupData.KofaxValues)
        {
            releaseSetupData.Links.Add(val.Name, KfxLinkSourceType.KFX_REL_VARIABLE, val.Name);
        }

Solution

  • Almost there. They can be found in the BatchVariableNames collection on the SetupData object. The following sample adds all of them to the Links collection, i.e. exposing them for release:

    foreach (var item in setupData.BatchVariableNames)
    {
        setupData.Links.Add(item, KfxLinkSourceType.KFX_REL_VARIABLE, item);
    }