append to StringList

append to string list storing only the last value…

need to loop over document list and inside that i have one document which has some fileds, i would like to strore one perticular field value to list…i.e append to String list …after each iteration…

But its storing only the last value to ToList. How can i do that?

need help ??

hi prasanth,

Drop the from item inside the loop

No still i’m facing the problem

As Shan suggested you most likely are not dropping the variable. Why don’t you send us the screen shot of your pipeline where you are using append to String list function ?

please find the screen shot… i need the two values to be stored in string list.

i.e aa and bb. but list contains only last value i.e bb after iterations.

help me plz.
1.zip (11.6 KB)

and also need how to convert a document list to string list

Prasanth,

Attach is the example how you to use to appendToStringList service, also if you would have check the “Built In Services Guide” you would have solve this issue long before so I would recommend to check the documentation of the service before using it.

Also there is no builtin service which converts documentList to stringList, but if you want to do that, you can simply loop over the documentList and append that to stringList like you are doing in the above example but with any branch step.
appendToStringList Example.jpg

Hi Team,

I am new to webMethods.I want to print whatever elements in input list it should be printed in lower case in output.Could please provide solution to my problem.

Input as String list ex: A,B,C
Output as String list ex: a,b,c

Hi Lavanya,

can you explain your problem please?
Please provide a screenshot of your loop definition (esp. values for input array and output array).

I just have rebuilt your service as shown above on wM 9.12 and it works.

Regards,
Holger

1 Like

Hi Lavanya,

your screenshot already showing the result as lowercase, so any other problem you forgot to mention here.

Regards,
Firoz N

1 Like

Hi Holger,

Thanks for your reply!
I wanted to know that my input consists of String list of A,B,C . But output string list consists of only lowercase ‘a’.

Please find the below snip for your reference.

Hi Lavanya,

Even when using a ForEach-Transformer (while disabling the loop-variant) with embedded toLower transformer I get the expected results.

Regards,
Holger

Hi Firoz,

Thanks for your reply!
input string list have A,B,C
But output String list have only ‘a’ ? why not lowercase ‘b,c’

Hi Lavanya,

you have to click on the output list and scroll down a little bit (eventually moving the divider bar up a little bit) to see the complete content of the list.
In the overview it is only showing the first element of the list.
Same applies to the input list.

Regards,
Holger

1 Like

Lavanya,

Ensure your mapping string input to the input parameter of toLowerCase built-in service and output to an output string variable. If you properly define input and output array for the loop then put a map step under the loop, they will show up correctly.

You can cross verify this once if you still see only ‘a’ in output

Regards,
Firoz N

1 Like

Thanks a lot Holger & Firoz

1 Like

If it is working whatever might be the issue, then we should be good. Thanks for letting us know

As far as I can tell this was just a displaying issue in Designer in the results view, where in the pipeline overview the lists are only displayed with their first item.
When clicking on one of them their complete content will be shown below the pipeline overview.

Regards,
Holger