Using rules to auto-complete a text-box field - InfoPath Dev
in

InfoPath Dev

Using rules to auto-complete a text-box field

Last post 01-10-2012 06:05 AM by DavidZ. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 01-09-2012 09:05 AM

    • DavidZ
    • Not Ranked
    • Joined on 01-04-2012
    • Posts 7

    Using rules to auto-complete a text-box field

    I have a SharePoint list with two fields - Name and Description. In my form I have a drop down box which is tied to Name. I want another field in the form to auto-complete with the corresponding Description once the Name field is chosen by the user. The ways that I have attempted so far only populate the text box with the first item from the list of names. Hope this makes sense. Thanks!

  • 01-09-2012 12:21 PM In reply to

    Re: Using rules to auto-complete a text-box field

    Hi DavidZ,

    The simplest way of doing this is through rules.  Create a new Action rule on the dropdown list box that goes something like "if Name is equal to Item1" then Set a Field's value to "Description1".  You can create a rule for every item you have in your list to have a different description for each.

    Let me know if you need additional help creating the rules and I'd be more than happy to help!

    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 01-09-2012 12:43 PM In reply to

    • DavidZ
    • Not Ranked
    • Joined on 01-04-2012
    • Posts 7

    Re: Using rules to auto-complete a text-box field

    Thanks Anson. Are you saying I would have to create a new rule for every "Name" in my SharePoint list?

     I'm looking for a way for InfoPath to grab the correct corresponding "Description" once the Name field is selected. Is this not possible?

  • 01-09-2012 01:23 PM In reply to

    Re: Using rules to auto-complete a text-box field

    Ah yes, that is certainly possible.  If you only plan to have a few Names (~4 to 5), then adding a rules for each is probably the quickest way.  If you have lots of names then you can create a secondary data connection to your SharePoint list and use query fields to search for the description that matched the selected name.  You can read more about query fields in thsi blog post below. You'll need 2010 to leverage queryFields in InfoPath.

    http://blogs.msdn.com/b/infopath/archive/2010/05/06/sharepoint-list-data-connections-in-infopath-2010.aspx

    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 01-09-2012 01:47 PM In reply to

    • DavidZ
    • Not Ranked
    • Joined on 01-04-2012
    • Posts 7

    Re: Using rules to auto-complete a text-box field

    Unfortunately I'm on MOSS 2007 so it doesn't sound like Query fields are supported in the way that I need. I'm surprised this type of thing was not supported in InfoPath 2007. Thanks for your input Anson.

  • 01-10-2012 06:05 AM In reply to

    • DavidZ
    • Not Ranked
    • Joined on 01-04-2012
    • Posts 7

    Re: Using rules to auto-complete a text-box field

    OK, here is the correct way to accomplish this:

    1. Add a calculated field, hit the fx button
    2. Insert field or group
    3. Choose the appropriate data source
    4. Expand the list and choose your field
    5. Click Filter Data...
    6. Click Add
    7. Now change the expression so that the item chosen in your drop down matches an item in your data source.
    8. Click OK all the way out and test

    Now in your form, on preview, when you change the drop down field, the new calculated field will display the matching item from your list.

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