SOLUTION :)
We have to target XML content and then using xml method "postion() = 2" will set value in dropdown2 during change in dropdown1 selection.
Create a rule in dropdown1 properties:
In the Rule dialog box, click Add Action.
In the Action dialog box, select Set a field's value from the Action drop-down list box.
In the Action dialog box, click the button behind the Field text box.
In the Select a Field or Group dialog box, click dropdown2, and then click OK.
In the Action dialog box, click the button behind the Value text box.
In the Insert Formula dialog box, click Insert Field or Group.
In the Select a Field or Group dialog box, select items (Secondary) from the Data source drop-down list box - I created Data Connection which receive fruits and vegetables (apple,carrot etc) from xml document. Here items is the field name which populate dropdown2...
In the Select a Field or Group dialog box, expand the item node, click the value node, and then click Filter Data.
In the Filter Data dialog box, click Add.
In the Specify Filter Conditions dialog box, select The expression from the first drop-down list box.
In the Specify Filter Conditions dialog box, type the following expression in the text box:
position() = 2
In the Specify Filter Conditions dialog box, click OK.
In the Filter Data dialog box, click OK.
In the Select a Field or Group dialog box, click OK.
In the Insert Formula dialog box, click OK.
In the Action dialog box, click OK. (Action dialog box value text box should look like: FruitsVegetable[position()=2. Here, FruitsVegetable is xml node which populate dropdown2)
In the Rule dialog box, click OK.
In the Rules for Opening Forms dialog box, click OK.
In the Form Options dialog box, click OK.
- Chintan
Thanks,
Chintan