Greg Collins HOW TO Populate Fields... - InfoPath Dev
in

InfoPath Dev

Having trouble finding a blog or post that answers your question? Check out our Custom Search Page

Greg Collins HOW TO Populate Fields...

Last post 05-02-2007 07:55 AM by Matt Faus. 25 replies.
Page 1 of 2 (26 items) 1 2 Next >
Sort Posts: Previous Next
  • 03-15-2007 02:49 PM

    Greg Collins HOW TO Populate Fields...

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

    Brilliant, thank you - exactly what I needed.

    But now I need to know how to do *exactly* that, but using a data source from a table in a local MDB file. I've tried to adapt it (got past the trust issues, grrr) but cannot for the life of me get it to populate.

    Can someone (perhaps Greg?) do a similar HOW TO, but using a local Access table instead? Strikes me that the meat of the problem lies in the way the rules entry works for the xdXDocument:GetDOM("Clients")/ClientInfo/Clients/Client/Name[../ID = current()] part.

    I'm so new to this I am still wrapping my head around that first example - I can pretty much muddle my way through everything else in creating local forms that don't use sharepoint, but this problem has me stumped.

  • 03-16-2007 10:00 AM In reply to

    Re: Greg Collins HOW TO Populate Fields...

    That rule is based off on the specific Clients.xml file and it's particular schema. Thus, unless your MDB file has the exact same schema, it won't work using the same XPath.

    You need to convert the XPath: xdXDocument:GetDOM("Clients")/ClientInfo/Clients/Client/Name[../ID = current()] to match your MDB schema.

    First -- I am assuming that you are getting your drop-down to populate from your MDB file. Then you'll need to just follow the steps under the header "Fill the drop-down list with values from the secondary data source and add rules:", but substituting in your MDB fields in place. It should work the same. Yours might look somehting like:

    xdXDocument:GetDOM("MyAccessMDB")/RootNode/Table/Row/Field[../DropDownField = current()]
  • 03-21-2007 07:26 AM In reply to

    Re: Greg Collins HOW TO Populate Fields...

    I am not sure if I am getting a form security data access error, or my syntax is wrong - perhaps you can direct me.

    My database is in Access.

    It is on drive C:

    Its called "vpdataxml"

    The table is called "libinscos"

    My ID field is called "pkguid"

    The form field is called "Companyname"

    The field in access for Companyname is "insureco"

    So, based on this, what should my XPath look like? Right now I have:

    xdXDocument:GetDOM("libinscos")/dfs:myFields/dfs:dataFields/d:libinscos/@insureco[@pkguid = current()]
  • 03-21-2007 08:46 AM In reply to

    Re: Greg Collins HOW TO Populate Fields...

    Hi Jay,

    The XPath you listed is invalid, regardless of how your database is setup. You are trying to get the attribute (specifed by the @symbol) of an attribute, which is impossible.

    To help you construct your XPath you should open the Data Source task pane, and then select your data source from the drop down. After this, expand the groups until you find the field you want, and then construct your XPath by walking down the tree. The only thing that will have an @ symbol are attibutes, which are displayed in purplish looking piece of paper.
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 03-21-2007 08:53 AM In reply to

    Re: Greg Collins HOW TO Populate Fields...

    Its inserting the @ symbol when I do that - I used the Data Source task list and did a right-click Copy XPath and the @ gets put in automagically.

    Sorry Matt but you're going to have to assume I am dumber than your answer presumes me to be... (LOL)

    This is what I come up with doing it by hand:

    xdXDocument:GetDOM("libinscos")/dfs:myFields/dfs:dataFields/d:libinscos/insureco[pkguid=current()]

    But it doesn't like it...

    I'm still not getting fundamentally how this string is constructed...
  • 03-21-2007 11:57 AM In reply to

    Re: Greg Collins HOW TO Populate Fields...

    Hey Jay,

    No worries. Can you send me a screenshot (or better yet, post one on the forum) of the Data Source taskpane with the appropriate DOM displayed? With this I can give you a better explanation.
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 03-23-2007 06:11 AM In reply to

    Re: Greg Collins HOW TO Populate Fields...

    Okay, I've included my form and the mdb data source here:http://www.jaypatterson.com/infopath in the zip file.

    The other problem I have, which I think is a security/domain issue is getting the data to appear reliably in the drop down. I get this message consistently:

    http://www.jaypatterson.com/infopath/Cap3.JPG

    On a WinXP box, I do get it populated in design mode but I still get the error message. On the Vista box, I get nothing.

    Second, here is the Data Pane:

    http://www.jaypatterson.com/infopath/cap1.JPG

    Thirdly, here is the field def:

    http://www.jaypatterson.com/infopath/cap2.JPG

    Hope this helps...
  • 03-23-2007 06:15 AM In reply to

    Re: Greg Collins HOW TO Populate Fields...

    P.S. I am trying to use Infopath without Sharepoint as a very basic form app, saving the individual filled forms in customer folders. Most of my forms can be made more easily filled out as our list libraries are currently contained in an Access application. If I can generically understand how to do that and set it up successfully, 90% of what we need Infopath to do would be achievable. I am actually surprise MS didn't build in some kind of lookup list wizard to build these things - I would think most customers considering a solution like Infopath need this very basic capability right from the start.
  • 03-24-2007 07:45 AM In reply to

    Re: Greg Collins HOW TO Populate Fields...

    You were close! Here's what it should be:

    xdXDocument:GetDOM("libinscos")/dfs:myFields/dfs:dataFields/d:libinscos[@pkguid=current()/@pkguid]/@insureco

    You should be able to hook up your form to the SharePoint list rather easily. I found this video that explains how to do this in IP2003, but it should be pretty much the same process in IP2007:http://perseus.franklins.net/msnewengland/spslist.htm
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 03-26-2007 05:33 AM In reply to

    Re: Greg Collins HOW TO Populate Fields...

    I get an error with that formula: "@pkguid" does not point to a valid location path of a field or group.

    I am using InfoPath 2007

    Also, I want to use this form without Sharepoint, not with... (perhaps you misread my post).
  • 03-26-2007 10:30 AM In reply to

    Re: Greg Collins HOW TO Populate Fields...

    Instead of SharePoint lists you can use document types in our wonderful product, Database Accelerator. Actually, you can use it to "upgrade" several of SharePoint's features. Check it out here:http://www.qdabra.com/proddetail.asp?prod=QDBXL1
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 03-26-2007 02:11 PM In reply to

    Re: Greg Collins HOW TO Populate Fields...

    "@pkguid" does not point to a valid location path of a field or group."

    Do you have a suggestion as to why I get this error?
  • 04-04-2007 07:55 AM In reply to

    Re: Greg Collins HOW TO Populate Fields...

    Based on the lack of focused response, I guess my question is a little more complex than it looks.
  • 04-04-2007 08:05 AM In reply to

    Re: Greg Collins HOW TO Populate Fields...

    Hi Jay,

    Sorry for sluffing off here, but it's hard to debug these things through the forums. There are also times when things can get complicated that trial-and-error can be helpful. The XPath I gave on March 24 is my best guess, but without stepping through the form with you, I doubt I'll be able to do much more.
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 04-11-2007 12:39 PM In reply to

    Re: Greg Collins HOW TO Populate Fields...

    So'kay, I think I am going to hire someone to do that part of the forms, its too much for me to wrap my little brain around. I am hoping Infopath 2008 or whatever version they come out with next addresses this with a Wizard. Seems to me Microsoft's Wizards would suit a lot of common form component tasks that you'd otherwise have to code for...

    thanks for your help.
Page 1 of 2 (26 items) 1 2 Next >
Copyright © 2003-2012 Qdabra Software. All rights reserved.
View our Terms of Use.