Problem Referencing XML Datasource. - InfoPath Dev
in

InfoPath Dev

Problem Referencing XML Datasource.

Last post 02-09-2009 11:21 AM by e_stylzz. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-06-2009 07:20 AM

    Problem Referencing XML Datasource.

     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!!

  • 02-09-2009 04:37 AM In reply to

    Re: Problem Referencing XML Datasource.

    Hi,

    Try the following expression for getting the current role.

    xdXDocument:GetDOM("Roles")/roles/role/Name[../users/username = xdXDocument:get-DOM()/my:myFields/my:hiddenCurrentUser]   

     

     

    Swathip
    www.ggktech.com
  • 02-09-2009 11:21 AM In reply to

    Re: Problem Referencing XML Datasource.

     Beautiful!  Thank you so much!

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.