Scenario: I needed to find a way to use roles in a web enabled form which is not easily setup out of the box with Infopath. I following this post however which states that it can be done using an xml data source and some form open rules, and two hidden fields. Based on those steps, I have setup my hidden fields, and the current user field does pull the user. However, the current role does not pull any information even though my forumla for the default value validates.
The default value for the hidden role field (Step 2 # 3) is this:
xdXDocument:GetDOM("Roles")/roles/role/Name[xdXDocument:GetDOM("Roles")/roles/role/users/username = /my:myFields/my:hiddenCurrentUser]
My XML file looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<roles>
<role>
<Name>Admin</Name>
<users>
<username>Eric</username>
</users>
</role>
</roles>
Any ideas would be much appreciated!!