Please HELP!!! Need to populate info from XML Data Source based on an input string - InfoPath Dev
in

InfoPath Dev

Please HELP!!! Need to populate info from XML Data Source based on an input string

Last post 07-22-2010 02:06 PM by Rahil. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-20-2010 09:42 AM

    • Rahil
    • Not Ranked
    • Joined on 07-20-2010
    • Posts 5

    Please HELP!!! Need to populate info from XML Data Source based on an input string

    Hi,

    I'm not very savvy with InfoPath or XML so I am extremely lost at this point.  I'm currently working on a project where it is required to populate basic info i.e last name, first name based on an input string of the persons  SSN. I have conditions and rule setup to where if  I input the SSN and it's equal to the data source SSN it populates the fields I want, although it only populates the first record of my XML source. I was told that I need to setup an XPath query filter, but I have absolutely no idea how to code it. The auto-populate would occur when the user inputs an SSN and hits the submit button to retrieve the data.

    Here's the XML Data source:

      <?xml version="1.0" encoding="UTF-8" ?>

    - <dataroot xmlns:od="urn:schemas-microsoft-com:officedata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="MCTFS.xsd" generated="2010-07-07T12:48:36">
    - <MCTFS>
      <ID>1</ID>
      <SSN>456235632</SSN>
      <Last_x0020_Name>Jones</Last_x0020_Name>
      <First_x0020_Name>Jane</First_x0020_Name>
      <MI>S</MI>
      <Rank>PFC</Rank>
      <Grade>E-2</Grade>
      <Service>USMC</Service>
      <MOS>0651</MOS>
      <EAS>10/20/2012</EAS>
      <AFADBD>10/21/2008</AFADBD>
      <Race>White</Race>
      <Gender>F</Gender>
      <Command>MCAS CPEN</Command>
      <Unit>H&HS</Unit>
      <Subunit>S-6</Subunit>
      <RUC>M67604#http://M67604#</RUC>
      </MCTFS>
    - <MCTFS>
      <ID>2</ID>
      <SSN>895366021</SSN>
      <Last_x0020_Name>Kane</Last_x0020_Name>
      <First_x0020_Name>Joe</First_x0020_Name>
      <MI>M</MI>
      <Rank>Sgt</Rank>
      <Grade>E-5</Grade>
      <Service>USMC</Service>
      <MOS>2811</MOS>
      <EAS>08/10/2010</EAS>
      <AFADBD>06/2/2002</AFADBD>
      <Race>Black</Race>
      <Gender>M</Gender>
      <Command>3rd MAW</Command>
      <Unit>MAG-39</Unit>
      <Subunit>Maintenance Det</Subunit>
      <RUC>M40039#http://M40039#</RUC>
      </MCTFS>
    - <MCTFS>
      <ID>3</ID>
      <SSN>150448584</SSN>
      <Last_x0020_Name>Smith</Last_x0020_Name>
      <First_x0020_Name>John</First_x0020_Name>
      <MI>L</MI>
      <Rank>Cpl</Rank>
      <Grade>E-4</Grade>
      <Service>USMC</Service>
      <MOS>0418</MOS>
      <EAS>12/12/2010</EAS>
      <AFADBD>12/13/2006</AFADBD>
      <Race>White</Race>
      <Gender>M</Gender>
      <Command>MCIWest</Command>
      <Unit>BMO</Unit>
      <Subunit>KMO</Subunit>
      <RUC>M00682#http://M00682#</RUC>
      </MCTFS>
      </dataroot>
     
    its just a sample I made up to work with it, but I really need help!!! Thank you!!
  • 07-21-2010 02:07 AM In reply to

    Re: Please HELP!!! Need to populate info from XML Data Source based on an input string

    Hi Rahil,

    Welcome to our forums!

    Actually, there are lots of related blogs and threads which have some tips on how to auto-populate fields from an XML secondary source. Check this out:

    http://www.infopathdev.com/blogs/matt/archive/2006/04/18/Automatically-Populate-Fields-from-a-Drop_2D00_Down-Selection.aspx

    This tutorial uses a dropdown selection, just change it and use your SSN field.

    Hope this helps.

    Thanks,

     

    Jo-Anne Alfafara
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™
  • 07-22-2010 02:06 PM In reply to

    • Rahil
    • Not Ranked
    • Joined on 07-20-2010
    • Posts 5

    Re: Please HELP!!! Need to populate info from XML Data Source based on an input string

     

    Thank you! I finally figure it out! I think its the same as the tutorial there. Create the filter for the query on the secondary source! Thanks again!!
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.