Excel Data to Data Items

soginiski

New Member
Hello, I'm new here.

Can I ask if it's possible to have Excel values created as separate data items? Let's say I have a column of data item names and another column for its values.
Also, if that's not gonna work, is it possible to create data items if I fetched the data to a collection first, then get each row to create new data items?

Thanks!
 

VJR

Well-Known Member
Hi soginiski,

There doesn't appear to be an option in BP to dynamically create data items.
Assuming this is just a one time activity and not for doing it in an automated way through BP, you can try checking one thing. Create just 1 or 2 sample data items in a blank process. Then export the xml of that process to your desktop. Open the xml in any xml editor or even notepad. (To just view the xml you can open it in Internet Explorer). See how those data items are arranged in the xml. If it seems to be possible to add the tags for any new data items then you can form your Excel in such a way that xml tags get added to that xml (or even write some code to dynamically pick data from excel and insert as tags to xml) and then finally import the xml back to a new process with a new name. But if Blue Prism uses certain unique IDs to identify each data item then you might not be able to add the tags but is something to be researched for.
 

dallangoldblatt

New Member
I do not think what you want to do is possible, but I do have an alternative solution that may help.

I recommend importing the data from excel as a collection. Then you need to create a new action to transpose the collection so that your data item names become the column names, and the values become the first row (Utility - Collection Manipulation does have a Transpose action, but it only works in the opposite direction). Put the following code in a code stage (Visual basic) with inTable as an input (the imported collection) and outTable as the output.

Dim flippedTable As New DataTable
flippedTable.Columns.AddRange(
inTable.Select.Select(
Function(dr) New DataColumn("col" & inTable.Rows.IndexOf(dr), GetType(Object))
).ToArray)
For Each dc As DataColumn In inTable.Columns
flippedTable.Rows.Add(inTable.Select.Select(Function(dr) dr(dc)).ToArray)
Next
outTable = flippedTable


If you store outTable in a Data Item (lets call it Master Collection), you can now reference each of your "Data Items" using [Master Collection.Data Name].
 
Top