I am working on a workflow that will find all the documents in a folder and its sub-folder and rename the documents when the entry name does not match a custom field values.
I am using the Search Repository activity (called "Find A/P Vouchers") to find all documents in the folder and sub-folders. I have selected the custom field under the "Fields" section of the activity. The custom field seems to be pulled correctly because I have also included that custom field in the "Sort Found Entries by" property and the entries are being sorted.
In the For Each Entry activity the custom field seems to be blank (it is not blank in the document metadata).
I know it is blank because my "Branch" is testing to see if the entry name does not match the custom field value and if it does not it is inserting a record in a table.
The problem is that the Insert Data activity is executed for every entry, which means the condition is always coming back true.
I also know the custom field value is empty in the "Branch" activity because I am inserting the custom field value into the database and it is empty in the database.
First question: The only way I could find to find all documents in all sub-folders was to use the Search Repository activity. The Find Entries activity did not seem to give me the option to also include sub-folders. Is this the correct activity to use or is there a better one?
Second question: What am I doing wrong that my custom field value is not being passed from the Search Repository activity (Find A/P Vouchers) and the For Each Entry activity?