cancel
Showing results for 
Search instead for 
Did you mean: 

Code Stage Append dynamic fields to Existing collection

GowthamDhanekul
Level 3
Hi i have built a process where in a loop im using post request for each request i will get values and those values should be append to collection i should achieve this without using blueprism in-built vbo's .Should achieve only through code stage.Below is my code name,company,fqa are dynamic variables and file,doc,salar are rows i have written code to achieve this but collection contains only last value can any one help me to solve this issue.Thanks in Advance.

DataTable t = new DataTable();
DataRow row;
t = inpcollection;
row = t.NewRow();
row["file"] = namee;
row["doc"] = company;
row["salar"] = fqa ;
t.Rows.Add(row);
opcollection = t;

------------------------------
Dhanekula Gowtham
Dot Net Developer
intain technologies pvt limited
------------------------------
1 REPLY 1

John__Carter
Staff
Staff
Are you overwriting the collection on each iteration of the loop? You should be appending a new row each time, so in your code stage add a collection input param rather than instantiating the datatable t.

------------------------------
John Carter
Professional Services
Blue Prism
------------------------------