Doug Hauf
Doug Hauf

Reputation: 3213

How can I loop over a map of String List (with an iterator) and load another String List with the values of InputArray?

How can I iterate over a InputArray and load another input array with the same values except in lower case (I know that there is a string to lower function)?

Question: How to iterate over a String List with a LOOP structure?

InputArray: A, B, C

OutputArray should be: a, b, c

enter image description here

Upvotes: 3

Views: 10056

Answers (3)

Adhiraj
Adhiraj

Reputation: 81

I can see two cases out here.

If your input is a string

  1. Convert the string to stringlist by pub.string:tokenize service.
  2. Loop over the string list by providing the name of string list in input array property of loop.
  3. within loop use pub.string:toLower service as transformer and map the output to an output string.
  4. put the output string name in the output array property of Loop.
  5. once you come out of the loop you will see two string lists, one with upper case and one with lower case.

If your input is a string list.

In this case follow steps 2 to 5 as mentioned above.

Upvotes: 2

ngrashia
ngrashia

Reputation: 9904

In case, you want to retain the inputArray as such and save the lowercase values in an outputArray, then follow steps in below image which is self explanatory:

In the loop Step, Input Array should be /inputArray and Output Array should be /outputArray.

Steps and Output

Upvotes: 5

TchiYuan
TchiYuan

Reputation: 4278

Your InputArray field looks like a string field. It's not a string list.

You need to use pub.string:tokenize from the WmPublic package to split your strings into a string list and then loop through the string list.

A string field looks like this in the pipeline:

enter image description here

A string list looks like this in the pipeline:

enter image description here

See the subtle difference in the little icon at the left ?

Upvotes: 2

Related Questions