Hello Friends. In this BizTalk video I will be demonstrating
the steps to access Distinguished fields and Promoted Properties from Orchestration. First a brief detail about property promotion
in BizTalk. There are two ways in which elements from
our schema can be promoted in BizTalk. 1st is Promoted properties and 2nd is Distinguished
Fields. These 2 promotions can be done in 2 ways,
one is Quick Promotion and 2nd is show promotion. Using Quick promotion we can promote a property
and get the element added in property schema document in 1 step and using show promotion
we can set promoted property as well as distinguished fields. Now let’s start with the Demo. Now I have created a new BizTalk project. Now we will add a schema document to the project. We will name it Employee_Schema and add some
records and elements to it. We will name the root record as ‘Employees’
and add child record with the name ‘Employee’. We will add couple of elements to the Employee
record. I have added 5 elements to the Employee record. I have added Emp_ID, Emp_Name, Emp_Email,
Emp_Address and Mgr_ID. Now let us add some Promoted Properties and
Distinguished fields. Right click on the Emp_ID select Promote and
select ‘Quick Promotion’. Selecting Quick Promotion will create a new
Property_Schema file for us. Now we can ignore the Property1 field and
simply delete this element. You only require Emp_ID for now. Now this Emp_ID. Now this Emp_ID is the promoted property. Now let us set the Emp_Name field as Distinguished. We will go to the show promotions option. Now we are in the Distinguished field section. And select the Emp_Name and click on ‘Add’. This adds the Emp_Name. Now you can see that Emp_ID has been promoted
and Emp_Name is added as a Distinguished field. Now let’s promote Mgr_ID using Quick Promotion. Mgr_ID got added in Property_Schema. Now also let’s add Mgr_ID as Distinguished
field. The changes got reflected over here. Mgr_ID as a Promoted property as well as a
Distinguished field. Now in order to access these elements in orchestration,
let create a new Orchestration. Let us add an Expression shape in out Orchestration. Now in order to access the fields in our Orchestration,
we will have to create a new message and a new variable. Just create a new Message, rename it to ‘Msg’. Provide the message type as the schema that
we have created just now. Let us create a new variable and rename it
to ‘Var’. Let give its data type as string. Now we are ready access those Promoted and
Distinguished elements in our Expression shape. Now let us first try to access the distinguished
field. To access the Distinguished field we have
to use the dot(.) operator. Once we hit dot(.) we get the record name
under which out distinguished field is present. Once again we hit dot(.), we can see that
we had added Emp_Name and Mgr_ID as distinguished field. So this way we can access our distinguished
field. Let us try and access our Promoted properties. Now remember we had promoted 2 properties,
1 was Mgr_ID and the other was Emp_ID. Now in order to access the promoted property
we cannot use the dot(.) operator we have to hit the opening bracket ‘(‘ and we
get a popup of all the properties that we can use. Let us hit our Project name. So you can see that we are seeing 2 promoted
properties like Emp_ID and Mgr_ID. Once we select the field that we want we can
close the bracket ‘)’. This is the way in which you can access the distinguished
field using the dot(.) operator and the Promoted properties using brackets ‘(‘, ’)’ after
the message ‘Msg’ that we had created. In another video I will demonstrate how these
promoted properties can be used in context properties for routing of messages in BizTalk. Thank you so much for watching this video. Have a good day.