BizTalk Server Tutorial

BizTalk Server Concepts and Common Errors

Hidden Feature of Index Functoid

Today I came across one of the hidden features of Index Functoid that I feel worth to share.

We all know how to use Index Functoid to extract values at a particular index in a repeating record. We do this by configuring an index Functoid with two inputs (generally)

1. The repeating record’s element

2. Index value (starts with 1)

1

However, after reading the full functoid description, I was interested in the highlighted text which mean, index functoid can take >2 parameters depending on the depth of the hierarchy of the source schema. To explore more, consider a sample input like below.

2

Input has 3 departments HR, Admin & Sales. Consider the below simple map.

3

Test 1:
Functoid inputs: “Name” & “1”
4

Output 1:

5

So, it extracted the First Departments, first Employee.

Test 2:

Let us say, you want to extract the value “HREmployee1”.
Changing your index functoid input to “Name” & “2” will not give you a result. This is the trick. You should extract the first element of second employee record of first department.
Input: “Name”, “1”, “2”

6

Output 2: You get “HREmployee1”

7

Test 3:

Let us say, you want to extract the value “AdminEmployee2”.
Input should be: “Name”,1,3,2 (2 is for 2nd department)

8

Output 3:

9

One way to easily understand this is to look at the XSLT generated.
Hope this gives you an idea of extracting hierarchical values from source.

– Shiv

September 13, 2013 - Posted by | Maps | ,

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: