Workflow Soluiton

 View Only

Arrays Within Complex Data Type - View and Modify 

Jul 02, 2012 12:48 PM

In this article I'd like to share some information about how to handle data in arrays on your web form so you won’t have to straggle for hours in searching for some solution.

If you want to simply display data from array on your web form you can use one of List (ListItems, ListBox, ListSelect )components.

If you want to just view, add or remove value from array on your web you can use ListBuilder component.

But if you need to modify existing data in array with variable size probably the only option is to use DataGrid component. This component allows you to display only complex data types so you won't by able to display array of e.g. Text (String) or Integer data type. But even if you have complex data type it doesn't mean the victory. Problem is if you have array of some type within complex data type. In my case I was fighting with modification of array of additional telephone numbers (TelephoneNumberAdditionalList) for Active Directory user (ADUserInfo data type). In this case DataGrid component allows you to view all single attributes of variable but not the arrays within it.

To solve this problem I made complex data type called OfficeNumbers heaving only one property OfficeNumber of Text data type:

 

Then in the process Multiple Value Mapping component is used to copy data from array of user's additional telephone numbers to new array of OfficeNumbers data type called OutOfficeNumbers:

 

You might think of using  For Each Element in Collection and Add  Item To Collection components:

Unfortunately for me Add Item To Collection component threw error when I was trying to us it for complex data types:  you cannot set the contents of a constructed array

But in theory it should work.

 

So now we have data in variable of complex data type and it's possible to view them in Grid component :

 

To get modified data back where we want them I'm using Single Value Mapping component

 

In which I'm using for Process Mapping Assignment:

And inside of it all text elements from my OutOfficeNumbers array (OfficeNumbers data type) are added to Text data type array (using For Each and Add Items to collection components) which is mapped to output.

 

 

This is a part of the process I made to allow our Telco team modify telephone numbers for Active Directory accounts by them self's. 

Whole process looks like this:

I hope it's understandable:) If not do not hesitate to ask.

 

Regards,

Vlastik

 

 

 

 

Statistics
0 Favorited
1 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Related Entries and Links

No Related Resource entered.