after selecting a name from a dropdown box I need additional fields to auto populate from an XML file - InfoPath Dev
in

InfoPath Dev

after selecting a name from a dropdown box I need additional fields to auto populate from an XML file

Last post 01-03-2012 01:12 PM by jacyou. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-03-2012 11:25 AM

    • jacyou
    • Not Ranked
    • Joined on 01-03-2012
    • Posts 4

    after selecting a name from a dropdown box I need additional fields to auto populate from an XML file

    I hope someone can help me here. I have created a time off request form. I have a drop down box which an employee can select their name (XML file- employee name, employee's manager, days available for time off, and a id #) when they choose their name I would like the field for the managers name and time available to automatically populate once the employee selects their name.

    I set all types of rules and conditions, nothing seems to work.

    HELP me please!!

    Thanks

    Jack 

     

  • 01-03-2012 11:45 AM In reply to

    Re: after selecting a name from a dropdown box I need additional fields to auto populate from an XML file

    I'm assuming your xml file is set up as follows (or close to this):

    <employee>
          <EmployeeName>Tim</EmployeeName>
          <ManagersName>Tom</ManagersName>
          etc...
    </employee>
    <employee>
          <EmployeeName>Jim</EmployeeName>
          <ManagersName>James</ManagersName>
          etc...
    </employee>

    So what you want to do is add an expression for the default value that you want to set. If you want to set the value of Manager's Name in your form, you will add the following expression to the default value:

    ManagersName[EmployeeName = EmployeeName]

    ManagersName refers to the element in the secondary XML. You then add a filter to that (that is what is on the square brackets of the formula). One EmployeeName refers to the element of your main data source, and the other refers to the element in your secondary data source. You can call them whatever you want, I just made them the same name so it would make more sense. Use the formula builder to select the different elements and to add the filter.

    Let me know if you have anymore questions!

     

     

  • 01-03-2012 01:12 PM In reply to

    • jacyou
    • Not Ranked
    • Joined on 01-03-2012
    • Posts 4

    Re: after selecting a name from a dropdown box I need additional fields to auto populate from an XML file

    Thanks that worked great

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