I have a loop in a workflow and for each iteration of the loop, I want to overwrite the variable {global.var} with the following:
GetMeta('a_token%i[0]', 0, 'Job.Group.Document.DataPage.Page')...where '%i' is the iteration index.
For background: The document strips numbers from the body of the incoming data and stores each token as a new meta field.
Example
if found { definemeta('a_token'&count,'DATA') }
presume count = 4 for this purpose
So in effect we now have 4 meta data entries called 'a_token' and appended to the end of this is the number of the token which is found.
In the workflow I then need to loop over the tokens (I can use '&count' calculated by the ptalk in the document as a control variable) and extract them for each iteration of the loop - I then take the result, compare it to the current record in memory and conditionally perform an action - in this case it uses the token as a mask for a folder input command ('a_token' should match a filename in a directory)
The problem I am having is that when the loop executes, for the first iteration (0) the following works:
GetMeta('a_token%i[0]', 0, 'Job.Group.Document.DataPage.Page')...returning the data value stored in 'a_token', entry 0. When the loop then iterates again (iteration 1) it fails, giving error:
W3001 : Error while executing plugin: Error resolving data selection: Error loading metadata file: File not found
Set Job Infos and Variables: W1603 : Plugin failed - 23:00:04
Any ideas? Is there an easier way of doing this? Am I being a total plank?!