Major documentlist/stringlist issue when looping

Here is how the code looks:

Loop over items
I grab a field from item1 named NameList whose content could look like this: (‘ABP001’,‘ABP002’)
The NameList field is fed as input to a custom service named FormatMultiInput that removes the (’ and the output from that is Values\InString (document list). That document list is then mapped to another document list that I created called Test\InString (document list)
I get something that looks like this iin the results tab:
Test (document list)
Test[0]
InString ABP001
Test[1]
InString ABP002
Perfect! Now I loop over the document list and map to the appropriate field in the canonical. Everything works fine the first go-around. Now comes the problem.
I loop over item2:
Same deal. This time, NameList contains (‘GQP001’,‘GQP002’,‘GQP003’)
As you can see, this time there are three values instead of two.
The NameList field is fed as input to custom service named FormatMultiInput that removes the (’ and the output from that is Values\InString (document list). That document list is then mapped to Test\InString (document list) in pipeline out.
However, I see this in the results tab:
Test (document list)
Test[0]
InString GQP001
Test[1]
InString GQP002

What happened to the third value? I’ve been racking my brain for two days on this, trying different things here and there, but I get the same result no matter what. There is nothing wrong with the FormatMultiInput service (again custom code), as I stepped into it and verified that “3” values were sent to the output Vaues\InString, but only two mapped to the document list Test\InString. It’s as if Test\InString is saying “Because on the first go-around, you only mapped two values to this list, I’m not going to let you map anymore than that on future items as well”. This seems to be more of a documentlist/stringlist rule or something.

It’s like because for the first item, two values were mapped to Test\InString document list, if anything else is mapped to Test\Instring for other items, it must be two values as well. Seen this happen on both utilizing a stringlist and a documentlist. Here are other things I’ve tried and failed at:

  • After looping through Test\InString and mapping to the canonical, delete Test\Instring before you move on to the second item. Where would I do the delete at? I can’t do it while looping over Test\Instring

  • Right after LOOP over items, create Test\InString, doubleclick it, then just save it, so that the blue input arrow is on it. That way, when the LOOP starts looking at the second item, it would see Test\InString is reset (removing all entries from the first go-round) and hopefully I won’t have the issue. Didn’t work. The first item’s NameList didn’t work at all and provided no output when I did that.

Don’t understand the above either. If I provide a blank input to the document list, you can’t map values to the document list? Huh?

I’m just understanding how documentlist / stringlist works when you loop over items? I’m sure I’m missing something really simple and I badly need your help on this. My deadline on having this done is Monday and as you can see, I’m working on it over the weekend.

Any ideas would be greatly appreciated! Thanks.

Can you post a screen shot or pseudo FLOW steps so we can see what’s going on?

That sounds strange, and as you said should be something simple.
I think you need a second pair of eyes to look at the code, so please upload the package with the two services. May be someone can help.

can you send the export of the package,

Sorry for my delay in responding. Had a personal issue that occurred maybe an hour after posting. Anyway, it turns out that I did just need to step away from the code, because when I returned home today, I saw that it was just a simple case of just needing to drop the list. Therefore the very long speech that I wrote in my original question was for nothing and is embarrassing, but I was frustrated because of a deadline. Thanks for responding and my apologies.