How to add a value to list using add to collection Activity

Please help me how to add a value to a list variable using add to collection activity

Hi, what is the problem you are having?

@bcorrea I wanted to append new value to list, i am using add to collection activity but getting error.

Please find the below screenshot.

your type argument is String, and the item will be just a string too and not {""}

@bcorrea if i given string also it is throwing error.

as i said, you need to use String for the TypeArgument…

@bcorrea Got it Thanks

1 Like

Hi…

  1. take input from the user .o/p value is (InputVar ) .2)Use while ,add to collection, assign Activity 3.MessageBox Activity.

while (count<= InputVar ) //Variable Name - count
Add to collection Variable // Name Number // Variable type List //Default New List(of string)
Properties // Collection- Number //item- “Valuehere”+
InputVar.ToString //Type Argument-String

counter = counter+1 //Assign Activity
message box String.join(“Environment.NewLine”,counter)