I have a form that is routed to be worked based on the geographic location of the employee submitting the form. There are six territories for the purpose of routing the forms and more than six hundred buildings that are serviced by Desktop Support and Telecom Support employees. I created an xml file and saved it to our SharePoint with the podlisting.xml. I then setup a data connection to the xml file and when a building was selected the territory automaticated populated using a default value for the territory. This is all pretty straight-forward if an action occurred in a building it then was in a pre-defined territory. Recently, there has been a reorganization and realignment of the buildings within the territories. To balance the workload across the territories approximately 50 of the buildings now have a Desktop support from one territory and Telecom support from another. To address this issue I created another xml file with the building to territory assignment for the Telecom employees and named it telecompodlisting.xml.
Currently when someone from either group selects a building the City, State, & Territory are automatically populated. I set default values based on the podisting.xml secondary data source and then filtered by the building. Again this worked fine. I researched here and found a reference to this blog post.
In my form I have a category field. I was hoping to build a conditional default values on the category field. Basically if the category field had the word Telecom at the beginning of the field it would then force the Territory field to retrieve the value from the Telecompodlisting.xml and if the category field was something else it was use the original poslisting.xml file to populate the territory. Below is the syntax for the default value I created based on the blog post.
concat(substring(xdXDocument:GetDOM("podlisting")/dataroot/BUILDINGS/Territory[../BldgCode = xdXDocument:get-DOM()/my:MyTest/my:Pod], 1, ../my:Cat[not(starts-with(., "Telecom"))] * string-length(xdXDocument:GetDOM("podlisting")/dataroot/BUILDINGS/Territory[../BldgCode = xdXDocument:get-DOM()/my:MyTest/my:Pod])), substring(xdXDocument:GetDOM("telecompodlisting")/dataroot/BUILDINGS/Territory[../BldgCode = xdXDocument:get-DOM()/my:MyTest/my:Pod], 1, ../my:Cat[starts-with(., "Telecom")] * string-length(xdXDocument:GetDOM("telecompodlisting")/dataroot/BUILDINGS/Territory[../BldgCode = xdXDocument:get-DOM()/my:MyTest/my:Pod])))
This however leaves the territory field blank when I select a building regardless if the word Telecom is entered in the category field or not. Any help would be greatly appreciated. I realize I can publish a separate template for the Telecom staff but would prefer to have a single template to worry about.
Thanks,
Michael Demski