I'm trying to use MNI to start a process for each element in a list of MyCDT, using "Run one instance for each item in <the list>". When specifying the input parameters to the child process, how do I retrieve the index of the item in the list, so I can pass that single element of the list as a parameter (vs the whole list)? I didn't see any process variable that I could use, is there some function I should use to retrieve the current MNI loop index?
Discussion posts and replies are publicly visible
Hi Brad,
You can use [tp!instanceIndex]
Example:
PV is myList
Input would be myList[tp!instanceIndex]
Interestingly when you call a sub-process as an MNI Appian seems to "know" to pass the relevant item from the array into the sub-process without you having to explicitly reference the item using tp!instanceIndex.
Yes - and (frustratingly) exactly how this works is not very well documented. Out of basic paranoia, I usually manually index the array being passed in anyway - somehow it also "knows" when this is done and passes in the manually-indexed entry, fortunately.